grafana/pyroscope

GitHub: grafana/pyroscope

Grafana 出品的持续性能分析平台,可将 CPU、内存、I/O 等资源消耗定位到代码行级别,帮助团队主动优化性能或快速排查生产事故。

Stars: 11279 | Forks: 732

Pyroscope

[![ci](https://github.com/grafana/pyroscope/actions/workflows/test.yml/badge.svg)](https://github.com/grafana/pyroscope/actions/workflows/test.yml) [![JS Tests Status](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/66b616db8d035054.svg)](https://github.com/grafana/pyroscope/actions?query=workflow%3AJS%20Tests) [![Go Report](https://goreportcard.com/badge/github.com/grafana/pyroscope)](https://goreportcard.com/report/github.com/grafana/pyroscope) [![License: AGPLv3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](LICENSE) [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fgrafana%2Fpyroscope.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fgrafana%2Fpyroscope?ref=badge_shield) [![Latest release](https://img.shields.io/github/release/grafana/pyroscope.svg)](https://github.com/grafana/pyroscope/releases) [![DockerHub](https://img.shields.io/docker/pulls/grafana/pyroscope.svg)](https://hub.docker.com/r/grafana/pyroscope) [![GoDoc](https://godoc.org/github.com/grafana/pyroscope?status.svg)](https://godoc.org/github.com/grafana/pyroscope) ## 🎉 **公告:全新的 Explore Profiles UI 发布了!** 我们非常高兴地宣布推出 **Explore Profiles UI**,这是一种探索和分析性能分析数据(profiling data)的全新方式——现已作为 Grafana Explore Apps 套件的一部分推出!这款新应用为您带来了**无需编写查询**、**直观**的体验来可视化您的性能分析数据,无需编写复杂的查询即可简化整个流程。 https://github.com/user-attachments/assets/4db19ec7-86f3-4701-8f5f-9b7ffcebd49c ## 什么是 Grafana Pyroscope? Grafana Pyroscope 是一个持续性能分析平台,旨在从您的应用程序中挖掘性能洞察,帮助您优化资源使用,例如 CPU、内存和 I/O 操作。使用 Pyroscope,您可以**主动**和**被动**地解决系统中的性能瓶颈。 典型的用例包括: - **主动:** 降低资源消耗,提高应用程序性能,或防止延迟问题。 - **被动:** 利用行级细节快速解决事故,调试活跃的 CPU、内存或 I/O 瓶颈。 Pyroscope 提供了强大的工具,让您可以全面了解应用程序的行为,同时允许您深入特定服务以进行更有针对性的根本原因分析。 ## Pyroscope 如何工作? ![deployment_diagram](https://grafana.com/media/docs/pyroscope/pyroscope_client_server_diagram_09_18_2024.png) Pyroscope 包含三个主要组件: - **Pyroscope Server:** 存储和处理性能分析数据的服务器组件。 - **Pyroscope SDKs(push) 或 Grafana alloy(pull):** Pyroscope 的客户端部分,从您的应用程序收集性能分析数据并将其发送到服务器。 - **Explore Profiles UI:** 一个无需编写查询、直观的 UI,用于可视化和分析性能分析数据。 ## [Pyroscope 在线演示](https://play.grafana.org/a/grafana-pyroscope-app/) [![Pyroscope GIF Demo](https://static.pigsec.cn/wp-content/uploads/repos/2026/03/02244e068e035058.gif)](https://play.grafana.org/a/grafana-pyroscope-app/) ## **快速开始:本地运行 Pyroscope 服务器** ### Homebrew ``` brew install pyroscope-io/brew/pyroscope brew services start pyroscope ``` ### Docker ``` docker run -it -p 4040:4040 grafana/pyroscope ``` 有关如何配置 Pyroscope 服务器的更多文档,请参阅[我们的服务器文档](https://grafana.com/docs/pyroscope/latest/configure-server/)。 ## **快速开始:在 Grafana 中运行 Explore Profiles UI** image ### Grafana Cloud 应用 UI 和服务器均已自动安装并运行——只需开始发送数据即可! ### Grafana OSS 您可以通过从 [Grafana 插件目录](https://grafana.com/grafana/plugins/grafana-pyroscope-app/) 安装插件,在 Grafana 中运行 Explore profiles UI。 欲了解更多信息,请查看 [Explore Profiles README](https://github.com/grafana/explore-profiles) ## 文档 有关如何将 Pyroscope 与其他编程语言一起使用、在 Linux 上安装或在生产环境中使用的更多信息,请查看我们的文档: * [入门指南](https://grafana.com/docs/pyroscope/latest/get-started/) * [部署指南](https://grafana.com/docs/pyroscope/latest/deploy-kubernetes/) * [Pyroscope 架构](https://grafana.com/docs/pyroscope/latest/reference-pyroscope-architecture/) ## 通过 Pyroscope Agent 发送数据到服务器(特定语言) 有关如何将 Pyroscope agent 添加到您的代码中的更多文档,请参阅我们网站上的 [agent 文档](https://grafana.com/docs/pyroscope/latest/configure-client/),或在下面找到特定语言的示例和文档:

Golang

Documentation
Examples

Java

Documentation
Examples

Python

Documentation
Examples

Ruby

Documentation
Examples

Node.js

Documentation
Examples

.NET

Documentation
Examples

eBPF

Documentation
Examples

Rust

Documentation
Examples
## [支持的语言][supported languages] 我们的文档包含最新的[支持的语言][supported languages]列表,以及[每种语言支持的性能分析类型][profile-types-languages]的概述。 请在 [我们的 issues](https://github.com/grafana/pyroscope/issues?q=is%3Aissue+is%3Aopen+label%3Anew-profilers) 或 [我们的 slack](https://slack.grafana.com) 中告诉我们您希望看到的其他集成。 ## 贡献 要开始贡献,请查看我们的[贡献指南](docs/internal/contributing/README.md) ### 感谢 Pyroscope 的贡献者!
标签:API集成, APM, CPU分析, Docker, Docker镜像, Go, Grafana, I/O操作, JARM, Profiling, Ruby工具, SRE, 代码级诊断, 偏差过滤, 全栈可观测性, 内存分析, 可观测性, 后端开发, 安全防御评估, 开源, 微服务监控, 性能监控, 性能调优, 持续性能分析, 故障排查, 日志审计, 火焰图, 请求拦截, 资源优化