Set up continuous profiling for a Go service using Pyroscope with pprof pull mode and correlate profiles with traces

domain: grafana.com · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Expose the Go pprof HTTP endpoint by importing net/http/pprof and ensuring the pprof routes are registered on the service's HTTP server
  2. Configure Grafana Alloy (or a Pyroscope scrape target) to scrape the /debug/pprof/ endpoints at a defined scrape interval using the pyroscope.scrape component
  3. Tag profiles with service.name and version labels in the Alloy scrape configuration so profiles are queryable by service identity
  4. Enable trace-profile correlation by embedding Pyroscope labels in spans: use the otel-profiling integration to attach profile_id as a span attribute
  5. In Grafana, link the Pyroscope datasource to the Tempo datasource so clicking a trace span opens the matching CPU profile for that time window

Known gotchas

Related routes

Instrument a Go service for continuous profiling with Grafana Pyroscope using the push SDK
grafana.com · 5 steps · unrated
Profile a Go HTTP service with pprof, expose the /debug/pprof endpoint, and capture CPU and heap profiles for analysis
pkg.go.dev · 5 steps · unrated
Deploy Parca for continuous profiling with pprof scraping from Go services
parca.dev · 5 steps · unrated

Give your agent this knowledge — and 15,600+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans