Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use pprof extension for profiling #31781

Closed
mmynk opened this issue Mar 15, 2024 · 6 comments
Closed

How to use pprof extension for profiling #31781

mmynk opened this issue Mar 15, 2024 · 6 comments
Labels

Comments

@mmynk
Copy link

mmynk commented Mar 15, 2024

Component(s)

extension/pprof

Describe the issue you're reporting

I am trying to use the pprof extension in an OpenTelemetry collector.

I have added the following to my config otelcol.yaml:

extensions:
  pprof:
  pprof/1:
    endpoint: "127.0.0.1:1777"
    block_profile_fraction: 3
    mutex_profile_fraction: 5
    save_to_file: "cpu.pprof"

However, I am not seeing anything at that endpoint. Also the following command errors out:

$ go tool pprof http://localhost:1777/debug/pprof/profile\?seconds\=30

Fetching profile over HTTP from http://localhost:1777/debug/pprof/profile?seconds=30
http://localhost:1777/debug/pprof/profile?seconds=30: Get "http://localhost:1777/debug/pprof/profile?seconds=30": dial tcp 127.0.0.1:1777: connect: connection refused
failed to fetch any source profiles

I am sure I am missing something but being inexperienced with using profilers, I am not sure what. Do I need to ListenAndServe manually? Would appreciate any guidance.

@mmynk mmynk added the needs triage New item requiring triage label Mar 15, 2024
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@mmynk
Copy link
Author

mmynk commented Mar 18, 2024

/label help-wanted @MovieStoreGuy

Copy link
Contributor

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label May 30, 2024
@honeychaudharyc
Copy link
Contributor

honeychaudharyc commented Jul 8, 2024

Hi @mmynk,
Can you try below configuration in your otelcol.yaml file-

receivers:
  otlp:
    protocols:
      http:
      grpc:

processors:
  batch:
    send_batch_max_size: 100
    send_batch_size: 10
    timeout: 10s

extensions:
  pprof:
    endpoint: localhost:1777

exporters:
  debug:
     verbosity: detailed 
    
service:
  extensions: [pprof]
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch]
      exporters: [debug]

I used this and it works-
pprof_extension

@github-actions github-actions bot removed the Stale label Jul 9, 2024
Copy link
Contributor

github-actions bot commented Sep 9, 2024

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the Stale label Sep 9, 2024
@mmynk
Copy link
Author

mmynk commented Oct 21, 2024

I had missed adding:
extension: [pprof] to service.

Thank you, @honeychaudharyc.

@mmynk mmynk closed this as completed Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants