Skip to content

Commit 33bf56d

Browse files
committed
Optimizing work with env
1 parent 5f5f977 commit 33bf56d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/asgi_monitor/metrics/get_latest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ def get_latest_metrics(registry: CollectorRegistry, *, openmetrics_format: bool)
3838
:returns: MetricsResponse
3939
"""
4040

41-
if "PROMETHEUS_MULTIPROC_DIR" in os.environ:
41+
if path := os.environ.get("PROMETHEUS_MULTIPROC_DIR"):
4242
registry = CollectorRegistry()
43-
multiprocess.MultiProcessCollector(registry)
43+
multiprocess.MultiProcessCollector(registry, path=path)
4444

4545
if openmetrics_format:
4646
headers = {"Content-Type": OPENMETRICS_CONTENT_TYPE_LATEST}

0 commit comments

Comments
 (0)