prometheus / prometheus/client_python
Async CustomCollector
未关闭
还没有人认领这个 Issue。
- 主要语言
- Python
- 星标
- 4.4k
- 派生
- 876
- 平均合并
- 8 天 4 小时
- 30 天内合并 PR
- 1
描述
So I need to obtain some metrics from a database and I'm planning to create a custom collector as described here: http://prometheus.github.io/client_python/collector/custom/
I use asyncpg to connect to PostgreSQL. My problem though is that asyncpg query needs to be called from an async function and collect() is synchronous.
Is there an async equivalent? It looks like the client supports being used from ASGI.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 issue 中链接的自定义 collector 文档以及客户端的 ASGI 支持开始。跟踪 collect() 的调用方式,并将该路径与 asyncpg 的要求进行比较。完成标准是确定并记录是否支持异步收集,或者在不支持的情况下定义客户端所需的行为。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- postgresql, python
- 领域
- backend, databases
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 25/100