{"id":15178448,"url":"https://github.com/grafana/otel-profiling-go","last_synced_at":"2025-10-03T17:16:11.556Z","repository":{"id":41979252,"uuid":"464665584","full_name":"grafana/otel-profiling-go","owner":"grafana","description":"Open Telemetry integration for Grafana Pyroscope and tracing solutions such as Grafana Tempo, Honeycomb, or Jaeger","archived":false,"fork":false,"pushed_at":"2024-12-12T15:33:19.000Z","size":35,"stargazers_count":93,"open_issues_count":1,"forks_count":2,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-03-31T04:07:18.999Z","etag":null,"topics":["go","honeycomb","honeycombio","jaeger","opentelemetry","opentracing","optimization","performance","pprof","profiler","profiling","trace","tracing"],"latest_commit_sha":null,"homepage":"https://pyroscope.io","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/grafana.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-28T22:32:56.000Z","updated_at":"2025-03-30T09:38:20.000Z","dependencies_parsed_at":"2023-11-16T05:23:52.007Z","dependency_job_id":"4d46681e-e862-4ddd-a62c-9f1d1e30040c","html_url":"https://github.com/grafana/otel-profiling-go","commit_stats":{"total_commits":23,"total_committers":3,"mean_commits":7.666666666666667,"dds":"0.34782608695652173","last_synced_commit":"98e430fb21f17d72a65d8980fa4b774eeb891676"},"previous_names":["pyroscope-io/otel-profiling-go","pyroscope-io/otelpyroscope"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana%2Fotel-profiling-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana%2Fotel-profiling-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana%2Fotel-profiling-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grafana%2Fotel-profiling-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grafana","download_url":"https://codeload.github.com/grafana/otel-profiling-go/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247595335,"owners_count":20963943,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","honeycomb","honeycombio","jaeger","opentelemetry","opentracing","optimization","performance","pprof","profiler","profiling","trace","tracing"],"created_at":"2024-09-27T15:03:17.353Z","updated_at":"2025-10-03T17:16:06.521Z","avatar_url":"https://github.com/grafana.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Profiling Instrumentation for OpenTelemetry Go SDK\n\n**NOTE**: This is an experimental package -- and will be officially supported in future versions of Pyroscope\n\nThe package provides means to integrate tracing with profiling. More specifically, a `TracerProvider` implementation,\nthat annotates profiling data with span IDs: when a new trace span emerges, the tracer adds a `span_id` [pprof tag](https://github.com/google/pprof/blob/master/doc/README.md#tag-filtering)\nthat points to the span. This makes it possible to filter out a profile of a particular trace span in [Pyroscope](https://pyroscope.io).\n\nNote that the module does not control `pprof` profiler itself – it still needs to be started for profiles to be\ncollected. This can be done either via `runtime/pprof` package, or using the [Pyroscope client](https://github.com/grafana/pyroscope-go).\n\nBy default, only the root span gets labeled (the first span created locally): such spans are marked with the\n`pyroscope.profile.id` attribute set to the span ID. Please note that presence of the attribute does not necessarily\nindicate that the span has a profile: stack trace samples might not be collected, if the utilized CPU time is\nless than the sample interval (10ms).\n\nLimitations:\n- Only CPU profiling is fully supported at the moment.\n\n### Trace spans profiles\n\nTo start profiling trace spans, you need to include our go module in your app:\n\n```\ngo get github.com/grafana/otel-profiling-go\n```\n\nThen add the pyroscope tracer provider:\n\n```go\npackage main\n\nimport (\n\totelpyroscope \"github.com/grafana/otel-profiling-go\"\n\t\"github.com/grafana/pyroscope-go\"\n)\n\nfunc main() {\n\t// Initialize your tracer provider as usual.\n\ttp := initTracer()\n\n\t// Wrap it with otelpyroscope tracer provider.\n\totel.SetTracerProvider(otelpyroscope.NewTracerProvider(tp))\n\n\t// If you're using Pyroscope Go SDK, initialize pyroscope profiler.\n\t_, _ = pyroscope.Start(pyroscope.Config{\n\t\tApplicationName: \"my-service\",\n\t\tServerAddress:   \"http://localhost:4040\",\n\t})\n\n\t// Your code goes here.\n}\n```\n\nTracing integration is supported in pull mode as well: if you scrape profiles using Grafana Agent, you should\nmake sure that the pyroscope `service_name` label matches `service.name` attribute specified in the OTel SDK configuration.\nPlease refer to the [Grafana Agent](https://grafana.com/docs/pyroscope/latest/configure-client/grafana-agent/go_pull/)\ndocumentation to learn more.\n\n## Example\n\nYou can find a complete example setup with Grafana Tempo in the [Pyroscope repository](https://github.com/grafana/pyroscope/tree/main/examples/tracing/golang-push).\n\n![image](https://github.com/grafana/otel-profiling-go/assets/12090599/31e33cd1-818b-4116-b952-c9ec7b1fb593)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrafana%2Fotel-profiling-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrafana%2Fotel-profiling-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrafana%2Fotel-profiling-go/lists"}