diff --git a/handlers/metrics.py b/handlers/metrics.py index 9bbc170..b5beb89 100644 --- a/handlers/metrics.py +++ b/handlers/metrics.py @@ -16,6 +16,7 @@ class user_info_struct: def metric_wrap(chatID:int, userName: str, length: int, attemptsCount: int): """Pass here chat ID, username, pipisa length and attempts count to wrap them into metric.""" + global METRICS_INITIALIZED if not METRICS_INITIALIZED: pipisa_length_metric = Gauge('user_length_total', 'Pipisa length', labelnames=['ChatID', 'Username']) user_attempt_metric = Gauge('user_attempts_total', 'Attempts count', labelnames=['ChatID', 'Username'])