为 NoneBot 和其他插件提供 Prometheus 监控支持
Project description
Nonebot Plugin Prometheus
✨ NoneBot Prometheus 监控插件 ✨
✨功能
- 自动挂载
/metrics路径,提供 Prometheus 监控数据 - 为其他插件提供统一的数据上报接口
📦 安装
- 使用 nb-cli
nb plugin install nonebot-plugin-prometheus
- 使用 uv
uv add nonebot-plugin-prometheus
- 使用 poetry
poetry add nonebot-plugin-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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nonebot_plugin_prometheus-0.3.6.tar.gz.
File metadata
- Download URL: nonebot_plugin_prometheus-0.3.6.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
464ff121bf1cc4d55e50f101ec344330ef7c5ee1df69ed99614ab1158004e6c9
|
|
| MD5 |
85993668cdbdad08a20af632bbe051f8
|
|
| BLAKE2b-256 |
0ebf5eb3ddcc27f7708cca75107d9988aa4ddc07f8cb708ae27cb3ef1c61b3ef
|
Provenance
The following attestation bundles were made for nonebot_plugin_prometheus-0.3.6.tar.gz:
Publisher:
release.yml on suyiiyii/nonebot-plugin-prometheus
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nonebot_plugin_prometheus-0.3.6.tar.gz -
Subject digest:
464ff121bf1cc4d55e50f101ec344330ef7c5ee1df69ed99614ab1158004e6c9 - Sigstore transparency entry: 157883341
- Sigstore integration time:
-
Permalink:
suyiiyii/nonebot-plugin-prometheus@a358d1f47ae68d68785cb3e7802f5969f15821ad -
Branch / Tag:
refs/tags/v0.3.6 - Owner: https://github.com/suyiiyii
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a358d1f47ae68d68785cb3e7802f5969f15821ad -
Trigger Event:
push
-
Statement type:
File details
Details for the file nonebot_plugin_prometheus-0.3.6-py3-none-any.whl.
File metadata
- Download URL: nonebot_plugin_prometheus-0.3.6-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cee09c467acfcd9523f914325c944f861ea942e8abfc6bc927973017cad0506e
|
|
| MD5 |
4d80a75479bb2511d1f331eb7bf5e5b9
|
|
| BLAKE2b-256 |
e4ae26fa0c3fd485fb3e6735e029c986b1138dc270d490907e2e457ecbbf5131
|
Provenance
The following attestation bundles were made for nonebot_plugin_prometheus-0.3.6-py3-none-any.whl:
Publisher:
release.yml on suyiiyii/nonebot-plugin-prometheus
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nonebot_plugin_prometheus-0.3.6-py3-none-any.whl -
Subject digest:
cee09c467acfcd9523f914325c944f861ea942e8abfc6bc927973017cad0506e - Sigstore transparency entry: 157883342
- Sigstore integration time:
-
Permalink:
suyiiyii/nonebot-plugin-prometheus@a358d1f47ae68d68785cb3e7802f5969f15821ad -
Branch / Tag:
refs/tags/v0.3.6 - Owner: https://github.com/suyiiyii
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@a358d1f47ae68d68785cb3e7802f5969f15821ad -
Trigger Event:
push
-
Statement type: