Skip to content

Commit

Permalink
adjust logging
Browse files Browse the repository at this point in the history
  • Loading branch information
jabelone committed May 31, 2024
1 parent 7d1ff23 commit f02a415
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions memberportal/membermatters/celeryapp.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
from celery import Celery, signals
from celery import Celery
from celery.signals import celeryd_init
from prometheus_client import CollectorRegistry, multiprocess, start_http_server
import logging

Expand All @@ -26,14 +27,14 @@ def debug_task(self):
print(f"Request: {self.request!r}")


@signals.celeryd_init.connect
def name_this_what_you_want(sender=None, conf=None, **kwargs):
logger.debug(
@celeryd_init.connect
def celery_prom_server(sender=None, conf=None, **kwargs):
logger.info(
"Starting CollectorRegistry() and multiprocess.MultiProcessCollector()..."
)
registry = CollectorRegistry()
multiprocess.MultiProcessCollector(registry)

logger.debug("Starting Prometheus metrics server on port 8000...")
logger.info("Starting Prometheus metrics server on port 8000...")
start_http_server(8000, registry=registry)
logger.info("Prometheus metrics server started on port 8000!")

0 comments on commit f02a415

Please sign in to comment.