Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async CustomCollector #1069

Open
takeda opened this issue Oct 31, 2024 · 1 comment
Open

Async CustomCollector #1069

takeda opened this issue Oct 31, 2024 · 1 comment

Comments

@takeda
Copy link
Contributor

takeda commented Oct 31, 2024

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.

@csmarchbanks
Copy link
Member

Not today, but adding async support for custom collectors would be a reasonable feature to add. I doubt I will have time to add it soon but would be happy to take a contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants