Configure Grafana Pyroscope pull mode with Grafana Alloy to scrape pprof endpoints from Go services and store profiles in Pyroscope

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

Steps

  1. Ensure Go services expose /debug/pprof/ by importing net/http/pprof; if not using http.DefaultServeMux, register the handlers manually on your ServeMux
  2. In your Grafana Alloy config file, define a pyroscope.write block pointing at the Pyroscope server or Grafana Cloud Profiles endpoint with appropriate authentication
  3. Add a pyroscope.scrape block specifying targets with the host:port of each service, a service_name label, and any additional labels for environment and version
  4. Under profiling_config, enable specific pprof profile types per target: profile.process_cpu, profile.godeltaprof_memory (preferred over heap for Go), profile.goroutine, as needed
  5. Set scrape_interval in the pyroscope.scrape block to control how often profiles are fetched; 15s–60s is typical depending on overhead tolerance
  6. In the Grafana Explore > Profiles view (or Pyroscope UI), select the service and profile type to render flamegraphs and diff profiles between time ranges or service versions

Known gotchas

Related routes

Set up continuous profiling for a Go service using Pyroscope with pprof pull mode and correlate profiles with traces
grafana.com · 5 steps · unrated
Instrument a Go service for continuous profiling with Grafana Pyroscope using the push SDK
grafana.com · 5 steps · unrated
Configure Grafana Alloy (the successor to the Grafana Agent) to scrape Prometheus metrics and forward them to Grafana Mimir via remote_write
grafana.com · 5 steps · unrated

Give your agent this knowledge — and 15,500+ 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