diff --git a/src/common/dramatiq.py b/src/common/dramatiq.py index 5c41054..ad87b6a 100644 --- a/src/common/dramatiq.py +++ b/src/common/dramatiq.py @@ -28,7 +28,9 @@ def decode(self, data: bytes) -> MessageData: def init_dramatiq(config: AppConfig): broker: Broker - DramatiqInstrumentor().instrument() + dramatiq_instrumentor = DramatiqInstrumentor() + if not dramatiq_instrumentor.is_instrumented_by_opentelemetry: + dramatiq_instrumentor.instrument() if config.DRAMATIQ.REDIS_URL is not None: broker = RedisBroker(url=config.DRAMATIQ.REDIS_URL)