Closed howardjones closed 1 year ago
Yeah, you can use the underlying prometheus_client
library to define other metrics to expose. As long as they use the same Registry
, those will also show up on the metrics endpoint, and by default they do use that same registry.
Ah thanks, I will give that a try. The prometheus_client docs are not super clear on how this should work for multiple instances of a class, but I'll figure that out :-)
Found an example from one of my apps: https://github.com/rycus86/webhook-proxy/blob/master/src/server.py#L51
So basically, just import the metric class from the client and initialise it as needed, then as long as the registries match it should work - and if you don't explicitly specify those them both the Flask metrics and your custom metrics will use the same default one.
Before I added prometheus-flask-exporter to my flask app, I already had a metrics page for statistics about some internal caching. Is it possible to either register that view with prometheus_flask_exporter somehow, or otherwise combine the two?