Skip to content

Commit

Permalink
Setting requests in progress multiprocess mode as livesum
Browse files Browse the repository at this point in the history
By default it was by pid, this could generate a lot of metrics in case
of many workers and multiprocess.
  • Loading branch information
rbizos committed Sep 19, 2022
1 parent fb7b9bb commit ca6333f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion starlette_prometheus/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from starlette.routing import Match
from starlette.status import HTTP_500_INTERNAL_SERVER_ERROR
from starlette.types import ASGIApp

REQUESTS = Counter(
"starlette_requests_total", "Total count of requests by method and path.", ["method", "path_template"]
)
Expand All @@ -31,6 +30,7 @@
"starlette_requests_in_progress",
"Gauge of requests by method and path currently being processed",
["method", "path_template"],
multiprocess_mode='livesum'
)


Expand Down

0 comments on commit ca6333f

Please sign in to comment.