Skip to content

Commit 032ea57

Browse files
authored
Make sure to noop when there is no DSN (#1852)
* Make sure to noop when there is no or invalid DSN
1 parent 086e385 commit 032ea57

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

sentry_sdk/integrations/opentelemetry/span_processor.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,14 @@ def on_start(self, otel_span, parent_context=None):
9898
if not hub:
9999
return
100100

101+
if not hub.client or (hub.client and not hub.client.dsn):
102+
return
103+
104+
try:
105+
_ = Dsn(hub.client.dsn or "")
106+
except Exception:
107+
return
108+
101109
if hub.client and hub.client.options["instrumenter"] != INSTRUMENTER.OTEL:
102110
return
103111

0 commit comments

Comments
 (0)