Skip to content

Commit

Permalink
Make sure to noop when there is no DSN (#1852)
Browse files Browse the repository at this point in the history
* Make sure to noop when there is no or invalid DSN
  • Loading branch information
antonpirker authored Jan 20, 2023
1 parent 086e385 commit 032ea57
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sentry_sdk/integrations/opentelemetry/span_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@ def on_start(self, otel_span, parent_context=None):
if not hub:
return

if not hub.client or (hub.client and not hub.client.dsn):
return

try:
_ = Dsn(hub.client.dsn or "")
except Exception:
return

if hub.client and hub.client.options["instrumenter"] != INSTRUMENTER.OTEL:
return

Expand Down

0 comments on commit 032ea57

Please sign in to comment.