bookwyrm/celerywyrm/apps.py

15 lines
430 B
Python
Raw Normal View History

2022-02-05 02:34:17 +00:00
from django.apps import AppConfig
from celerywyrm import settings
class CelerywyrmConfig(AppConfig):
name = "celerywyrm"
verbose_name = "BookWyrm Celery"
def ready(self) -> None:
if settings.OTEL_EXPORTER_OTLP_ENDPOINT or settings.OTEL_EXPORTER_CONSOLE:
2022-02-05 02:34:17 +00:00
from bookwyrm.telemetry import open_telemetry
open_telemetry.instrumentCelery()
open_telemetry.instrumentPostgres()