Skills2026年4月15日·1 分钟阅读

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.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Community
入口
Grafana Pyroscope
直接安装命令
npx -y tokrepo@latest install 138e4edf-38d7-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

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

常见问题

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.

引用来源 (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

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产