Skip to content

Commit 6b66460

Browse files
authored
Do not instrument multiple times dramatiq (#246)
1 parent 1351101 commit 6b66460

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/common/dramatiq.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ def decode(self, data: bytes) -> MessageData:
2828
def init_dramatiq(config: AppConfig):
2929
broker: Broker
3030

31-
DramatiqInstrumentor().instrument()
31+
dramatiq_instrumentor = DramatiqInstrumentor()
32+
if not dramatiq_instrumentor.is_instrumented_by_opentelemetry:
33+
dramatiq_instrumentor.instrument()
3234

3335
if config.DRAMATIQ.REDIS_URL is not None:
3436
broker = RedisBroker(url=config.DRAMATIQ.REDIS_URL)

0 commit comments

Comments
 (0)