Skip to content

Commit 9ddc7cd

Browse files
authored
Fixed prometheus metrics for multiple worker processes (#101)
1 parent 2515ef2 commit 9ddc7cd

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

taskiq/middlewares/prometheus_middleware.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,10 @@ def __init__(
8888
"Tome of function execution",
8989
["task_name"],
9090
)
91-
92-
start_http_server(port=server_port, addr=server_addr)
91+
try:
92+
start_http_server(port=server_port, addr=server_addr)
93+
except OSError as exc:
94+
logger.debug("Cannot start prometheus server: %s", exc)
9395

9496
def pre_execute(
9597
self,

0 commit comments

Comments
 (0)