Skip to main content

nonebot-plugin-prometheus

Project description

nonebot

Nonebot Plugin Prometheus

✨ NoneBot Prometheus 集成插件 ✨

license pypi

✨功能

  • 自动挂载 /metrics 路径,提供 Prometheus 监控数据
  • 为其他插件提供统一的数据上报接口

安装

  • 使用 pip
pip install nonebot-plugin-prometheus

接入方式

先在插件代码最前面声明依赖

from nonebot import require

require("nonebot_plugin_prometheus")

然后可以从插件导入相关指标对象使用,详情请参考 Prometheus Python Client 官方文档

from nonebot_plugin_prometheus import Gauge, Counter, Histogram, Summary

# Request counter
request_counter = Counter(
    "request_counter", "The number of requests"
)
request_counter.inc()

配置

# 是否开启 Prometheus 插件
prometheus_enable = True
# Prometheus 挂载地址
prometheus_metrics_path = "/metrics"

Note

使用插件需要支持 ASGI 的驱动器,例如 fastapi

相关仓库

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nonebot_plugin_prometheus-0.3.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nonebot_plugin_prometheus-0.3.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file nonebot_plugin_prometheus-0.3.0.tar.gz.

File metadata

File hashes

Hashes for nonebot_plugin_prometheus-0.3.0.tar.gz
Algorithm Hash digest
SHA256 9fcebfef21ab9871da9e89cff5901b6dd846cb07ea6d831b929436c6852bdc03
MD5 2b5c0ba8101eecd319899c859e8efa7f
BLAKE2b-256 768a416dfcf199bc062dab53d1cf93d3181408dc9bb0899518170ad5972df0f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for nonebot_plugin_prometheus-0.3.0.tar.gz:

Publisher: release.yml on suyiiyii/nonebot-plugin-prometheus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nonebot_plugin_prometheus-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_prometheus-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 977f3583fa6250ebd13167347ddfcb80160060697e67592a8c2f0bf81dde6972
MD5 058be0f8b4e5e8f673b9f1b2dc04edcc
BLAKE2b-256 aca8585b06e27cb91e58a8d1894a1a1e13eb1275f83fb8615f6f51201106690c

See more details on using hashes here.

Provenance

The following attestation bundles were made for nonebot_plugin_prometheus-0.3.0-py3-none-any.whl:

Publisher: release.yml on suyiiyii/nonebot-plugin-prometheus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page