Skip to content

Commit

Permalink
fix: 设置 metrics 端点的 Content-Type 为 text/plain
Browse files Browse the repository at this point in the history
  • Loading branch information
suyiiyii committed Dec 24, 2024
1 parent 7baeb6d commit b338ceb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion nonebot_plugin_prometheus/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@

async def metrics(request: Request) -> Response:
counter.inc()
return Response(200, content=generate_latest())
return Response(
200, headers={"Content-Type": "text/plain"}, content=generate_latest()
)


def enable_prometheus():
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "nonebot-plugin-prometheus"
version = "0.3.3"
version = "0.3.4"
description = "为 NoneBot 和其他插件提供 Prometheus 监控支持"
readme = "README.md"
requires-python = ">=3.9, <4.0"
Expand Down

0 comments on commit b338ceb

Please sign in to comment.