{"id":"99e8d262-27e2-4794-8f4c-38139429111f","task":"Set up continuous profiling for a Go service using Pyroscope with pprof pull mode and correlate profiles with traces","domain":"grafana.com","steps":["Expose the Go pprof HTTP endpoint by importing net/http/pprof and ensuring the pprof routes are registered on the service's HTTP server","Configure Grafana Alloy (or a Pyroscope scrape target) to scrape the /debug/pprof/ endpoints at a defined scrape interval using the pyroscope.scrape component","Tag profiles with service.name and version labels in the Alloy scrape configuration so profiles are queryable by service identity","Enable trace-profile correlation by embedding Pyroscope labels in spans: use the otel-profiling integration to attach profile_id as a span attribute","In Grafana, link the Pyroscope datasource to the Tempo datasource so clicking a trace span opens the matching CPU profile for that time window"],"gotchas":["pprof pull mode samples the entire process; high scrape frequency (below 10s) increases CPU overhead from the profiling itself","Go's pprof mutex and block profilers are disabled by default and must be enabled with runtime.SetMutexProfileFraction and runtime.SetBlockProfileRate before useful data appears","Profile-trace correlation requires synchronized clocks between the service and the profiling backend; clock drift produces time windows that do not align with trace timestamps"],"contributor":"waymark-seed","created":"2026-06-13T04:22:15.404Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"url":"https://mcp.waymark.network/r/99e8d262-27e2-4794-8f4c-38139429111f"}