starlette_exporter
starlette_exporter copied to clipboard
Need requests_inprogress metric as a default metric
This is one of the basic metrics when it comes to monitoring requests made to a server. Such a metric is useful to give additional insight on the kind of load that the server is going through in that particular moment.
This is the feature that I plan to work on for this package.
the requests_in_progress metric is now available in v0.10.0! Thanks @scotgopal for contributing it.
Since you requested paths in the metric, we can leave this issue open until we are also tracking the request path.
the requests_in_progress metric is now available in v0.10.0! Thanks @scotgopal for contributing it.
Since you requested paths in the metric, we can leave this issue open until we are also tracking the request path.
Duly noted. Thank you @stephenhillier . Hope we can work together in future contributions too.
I am going to close this as done, since in-progress requests metrics are working but I still haven't come up with a way to automatically label it by path.
If anybody needs in-progress requests counts by path, my suggestion for now is to just add an extra Gauge
to the function you are interested in (example borrowed from https://github.com/prometheus/client_python#gauge):
from prometheus_client import Gauge
g = Gauge('my_inprogress_requests', 'Description of gauge')
async def some_view(request):
with g.track_inprogress():
pass