We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3f1d0d1 commit 9c77959Copy full SHA for 9c77959
1 file changed
taskiq/middlewares/prometheus_middleware.py
@@ -84,17 +84,19 @@ def startup(self) -> None:
84
This function starts prometheus server.
85
It starts it only in case if it's a worker process.
86
"""
87
- from prometheus_client import REGISTRY, start_http_server # noqa: PLC0415
+ from prometheus_client import CollectorRegistry, start_http_server # noqa: PLC0415
88
from prometheus_client.multiprocess import ( # noqa: PLC0415
89
MultiProcessCollector,
90
)
91
92
if self.broker.is_worker_process:
93
try:
94
- MultiProcessCollector(REGISTRY)
+ registry = CollectorRegistry()
95
+ MultiProcessCollector(registry)
96
start_http_server(
97
port=self.server_port,
98
addr=self.server_addr,
99
+ registry=registry,
100
101
except OSError as exc:
102
logger.debug("Cannot start prometheus server: %s", exc)
0 commit comments