Skip to content

Commit

Permalink
docs(README): 更新安装方法并优化文档格式
Browse files Browse the repository at this point in the history
- 新增使用 nb-cli、uv 和 poetry 的安装方法
- 更新接入方式和配置部分的标题格式
- 修改 TODO 部分的标题格式
  • Loading branch information
suyiiyii committed Dec 25, 2024
1 parent 3fe4e4f commit a3edb39
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 20 deletions.
25 changes: 16 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,17 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.8.4
hooks:
# Run the linter.
- id: ruff
args: [ --fix ]
# Run the formatter.
- id: ruff-format
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.8.4
hooks:
# Run the linter.
- id: ruff
args: [--fix]
# Run the formatter.
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier
types_or: [javascript, jsx, ts, tsx, markdown, yaml, json]
exclude: "admin-frontend/"
stages: [pre-commit]
39 changes: 28 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ _✨ NoneBot Prometheus 监控插件 ✨_

</div>


<p align="center">
<a href="https://raw.githubusercontent.com/suyiiyii/nonebot-plugin-prometheus/main/LICENSE">
<img src="https://img.shields.io/github/license/suyiiyii/nonebot-plugin-prometheus.svg" alt="license">
Expand All @@ -24,18 +23,36 @@ _✨ NoneBot Prometheus 监控插件 ✨_

## ✨功能

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

## 📦 安装

- 使用 nb-cli

```sh
nb plugin install nonebot-plugin-prometheus
```

- 使用 uv

## 安装
```sh
uv add nonebot-plugin-prometheus
```

- 使用 poetry

```sh
poetry add nonebot-plugin-prometheus
```

- 使用 pip

```sh
pip install nonebot-plugin-prometheus
```

## 接入方式
## 🔌接入方式

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

Expand All @@ -57,7 +74,7 @@ request_counter = Counter(
request_counter.inc()
```

## 配置
## 🔧配置

```ini
# 是否开启 Prometheus 插件
Expand All @@ -70,12 +87,12 @@ prometheus_metrics_path = "/metrics"
>
> 使用插件需要支持 ASGI 的驱动器,例如 `fastapi`
## TODO
## 📝TODO

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

## 相关仓库

* [NoneBot2](https://github.com/nonebot/nonebot2)
* [Prometheus Python Client](https://github.com/prometheus/client_python)
- [NoneBot2](https://github.com/nonebot/nonebot2)
- [Prometheus Python Client](https://github.com/prometheus/client_python)

0 comments on commit a3edb39

Please sign in to comment.