Closed sshleifer closed 1 year ago
If I understand correctly you want to expose Prometheus metrics from your Quart application? I'd recommend using the ASGI middleware approach as I think that simplifies it a lot. Take a look at the quart middleware example.
As for the second question, you'd need to declare the metrics using the aioprometheus API. In your examples I think this means you would replace labelnames
with const_labels
which aioprometheus uses for labels that should always be included with all instances of the metric. If you don't explicitly specify a registry then the metric is automatically added to the default registry.
I'm migrating a web app from synchronous flask to asynchronous Quart + hypercorn.
We previously had the following line in our flask_app.py
which let another service scoop up prometheus metrics by calling
/metrics
.It seems like the correct alternative is from your docs
My second question is, do I need to migrate a bunch of metrics like below to aiprometheus.Summary? and if so what should
labelnames=["processing_type"]
be converted to?const_labels={'processing_type': 'processing_type'}
?