Skip to main content

为 NoneBot 和其他插件提供 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

TODO

  • 监控 NoneBot 相关指标
  • 支持通过对话查询指标数据

相关仓库

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.3.tar.gz (4.7 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.3-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for nonebot_plugin_prometheus-0.3.3.tar.gz
Algorithm Hash digest
SHA256 7494003343195f7669fde0246e2d9523f679ff69f25131b338d4e3b107df4a5e
MD5 d8de7305a55d4404d3f1b557c9579b10
BLAKE2b-256 6c81d7351f29228d99e12cca69da467b16d2eb8f57cc68a65e61c137809b8a65

See more details on using hashes here.

Provenance

The following attestation bundles were made for nonebot_plugin_prometheus-0.3.3.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.3-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_prometheus-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 12cf8292bdaf5cd6f0381021ed63c9b571e6d8f57d69d9628d706d37af78532d
MD5 04dcebb42ec0d993b62bc347acdb9c17
BLAKE2b-256 31f865531baab22d7734c2b04cced0caa07167b040e51120208d949cc70b1f99

See more details on using hashes here.

Provenance

The following attestation bundles were made for nonebot_plugin_prometheus-0.3.3-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