diff --git a/core/core/metrics.py b/core/core/metrics.py index 2b1f4a6..0905f18 100644 --- a/core/core/metrics.py +++ b/core/core/metrics.py @@ -42,6 +42,8 @@ class TicketCountCollector(object): def collect(self): counter = CounterMetricFamily("c3lf_ticket_count", "Current number of tickets", labels=['event', 'event_id']) + yield counter + if not apps.models_ready or not apps.apps_ready: return @@ -53,8 +55,6 @@ class TicketCountCollector(object): yield counter -try: - REGISTRY.register(ItemCountCollector()) - REGISTRY.register(TicketCountCollector()) -except Exception as e: - print(e) + +REGISTRY.register(ItemCountCollector()) +REGISTRY.register(TicketCountCollector())