Repolode
prometheus

prometheus/client_python

Prometheus 官方 Python 客户端库,用于以 Prometheus 格式暴露应用指标。

Star
4,384
Fork
904
未关闭 Issue
172
最近提交
8天前

这是什么?

prometheus_client 是 Prometheus 官方提供的 Python 指标埋点库。它可以让 Python 应用定义计数器(Counter)、仪表盘(Gauge)、直方图(Histogram)等指标,并通过 HTTP 暴露出来,供 Prometheus 服务端抓取。

该包可通过 pip 从 PyPI 安装,完整文档托管在项目的 GitHub Pages 站点上,版本更新记录则保存在 GitHub Releases 页面中。

适合已经在使用 Prometheus、需要为 Python 服务、脚本或 exporter 添加监控数据的开发者。

核心功能

  • 01提供计数器、仪表盘、直方图和摘要等指标类型。
  • 02通过 HTTP 暴露指标,供 Prometheus 抓取。
  • 03可通过 pip 从 PyPI 安装。
  • 04作为 Prometheus 官方 Python 客户端持续维护。

适用场景

  • 为 Python Web 服务添加请求数和延迟等指标。
  • 为后台任务或脚本添加监控埋点。
  • 用 Python 编写自定义 Prometheus exporter。

快速上手

  1. 1

    从 PyPI 安装软件包

    pip install prometheus-client

收录于专题

标签

常见问题

client_python 是什么?
Prometheus 官方 Python 客户端库,用于以 Prometheus 格式暴露应用指标。 prometheus_client 是 Prometheus 官方提供的 Python 指标埋点库。它可以让 Python 应用定义计数器(Counter)、仪表盘(Gauge)、直方图(Histogram)等指标,并通过 HTTP 暴露出来,供 Prometheus 服务端抓取。
client_python 可以免费使用吗?用的什么许可证?
client_python 以 Apache-2.0 许可证开源。用于商业产品前,请先确认许可证条款。
client_python 还在维护吗?
活跃维护中。client_python 最近一次提交是在 2026年10月30日。
client_python 适合用来做什么?
为 Python Web 服务添加请求数和延迟等指标。 为后台任务或脚本添加监控埋点。 用 Python 编写自定义 Prometheus exporter。
client_python 怎么安装和运行?
从 PyPI 安装软件包: pip install prometheus-client
在哪里获取 client_python?
源代码和安装说明在 GitHub 上:https://github.com/prometheus/client_python

概要由 AI 根据项目 README 生成;GitHub 数据每日更新。

相关项目