diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index f02ecf1..bc0aba7 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -1,2 +1,3 @@ Guillaume Gauvrit -Michael Vieira \ No newline at end of file +Michael Vieira +Andrew Gershman \ No newline at end of file diff --git a/src/celery_prometheus/prometheus_bootstep.py b/src/celery_prometheus/prometheus_bootstep.py index 699e521..c729edc 100644 --- a/src/celery_prometheus/prometheus_bootstep.py +++ b/src/celery_prometheus/prometheus_bootstep.py @@ -1,5 +1,6 @@ """Helper for celery.""" import logging +import os from argparse import ArgumentParser from typing import Any, Mapping, Optional, cast @@ -26,7 +27,11 @@ def add_prometheus_option(app: Celery) -> None: if celery_version.major < 5: def add_preload_arguments(parser: ArgumentParser) -> None: - parser.add_argument("--prometheus-collector-addr", default=None, help=help) + parser.add_argument( + "--prometheus-collector-addr", + default=os.getenv("CELERY_PROMETHEUS_COLLECTOR_ADDR"), + help=help, + ) app.user_options["preload"].add(add_preload_arguments) else: