ConfigsApr 15, 2026·3 min read

Grafana Pyroscope — Continuous Profiling Backend

Open-source continuous profiling backend from Grafana Labs that ingests pprof and eBPF profiles, supports label-based queries, and links traces to flamegraphs.

TL;DR
Pyroscope records CPU, memory, and lock profiles from production services and exposes them as label-queryable flamegraphs.
§01

What it is

Grafana Pyroscope is a continuous profiling backend that records CPU, memory, goroutine, and lock profiles from production services. After joining Grafana Labs, it was merged with Phlare into a single Grafana-integrated backend that supports both pull (pprof-scrape) and push (agent SDK) ingestion.

It is designed for backend engineers and SREs who need to understand where their services spend time and memory in production, not just in local benchmarks.

§02

How it saves time or tokens

Continuous profiling eliminates the guesswork of performance debugging. Instead of adding ad-hoc profiling code and redeploying, Pyroscope records profiles continuously with low overhead. The diff mode lets you compare two time ranges or deployments instantly, pinpointing which function calls regressed.

§03

How to use

  1. Run the all-in-one binary: docker run -d --name pyroscope -p 4040:4040 grafana/pyroscope:latest
  2. Instrument your service with the Pyroscope SDK (Go, Java, Python, Ruby, .NET, Node.js, Rust)
  3. View flamegraphs at http://localhost:4040 or in Grafana with the Pyroscope data source
§04

Example

package main

import (
    "github.com/grafana/pyroscope-go"
)

func main() {
    pyroscope.Start(pyroscope.Config{
        ApplicationName: "my.service",
        ServerAddress:   "http://pyroscope:4040",
        ProfileTypes: []pyroscope.ProfileType{
            pyroscope.ProfileCPU,
            pyroscope.ProfileAllocObjects,
            pyroscope.ProfileAllocSpace,
            pyroscope.ProfileInuseObjects,
            pyroscope.ProfileInuseSpace,
        },
    })
    defer pyroscope.Stop()

    // Your application code here
}
# Run Pyroscope locally
docker run -d --name pyroscope -p 4040:4040 grafana/pyroscope:latest

# Open the UI
open http://localhost:4040
§05

Related on TokRepo

§06

Common pitfalls

  • CPU profiling overhead is typically under 2%, but memory profiling with high allocation rates can add noticeable overhead
  • The pull mode requires your service to expose a pprof endpoint, which may need firewall rules in production
  • Grafana integration requires configuring the Pyroscope data source; it does not appear automatically

Frequently Asked Questions

What languages does Pyroscope support?+

Pyroscope supports Go, Java, Python, Ruby, .NET, Node.js, and Rust through native SDKs. It also supports eBPF-based profiling for any language running on Linux without code changes.

How much overhead does continuous profiling add?+

CPU profiling typically adds less than 2% overhead. Memory profiling overhead depends on allocation rate. The pull mode (scraping pprof endpoints) has even lower overhead since it samples periodically rather than continuously.

How does Pyroscope integrate with Grafana?+

Add Pyroscope as a data source in Grafana, then create dashboard panels that display flamegraphs alongside your metrics, logs, and traces. Span profiles link individual trace spans to their corresponding flamegraph frames.

Can I compare performance between deployments?+

Yes. The diff mode lets you select two time ranges and view a differential flamegraph showing which functions got faster or slower. This is useful for validating performance improvements or catching regressions after deploys.

Is Pyroscope the same as Phlare?+

Pyroscope and Phlare were merged after Grafana Labs acquired Pyroscope. The combined project is now called Grafana Pyroscope and is the recommended continuous profiling solution in the Grafana ecosystem.

Citations (3)
  • Pyroscope GitHub— Pyroscope is a continuous profiling backend from Grafana Labs
  • Pyroscope Documentation— Supports pprof, eBPF, and native SDKs for Go, Java, Python, Ruby, .NET, Node.js,…
  • Grafana Blog— Merged with Phlare into a single Grafana-integrated backend

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets