Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow OTEL instrumenter to work even with no DSN. #3898

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jwhitaker-gridcog
Copy link

@jwhitaker-gridcog jwhitaker-gridcog commented Dec 31, 2024

Allow OTEL instrumenter to work even with no DSN.

Context: we are writing tests for our Sentry integration itself, setting up a client like

events = []
c = sentry_sdk.Client(dsn=None, instrumenter='otel', transport=events.append)

, and verifying that events contains spans from OpenTelemetry such as

with tracer.start_as_current_span('fn'):
   raise Exception('boo')

assert events = [...]

This currently doesn't work because the Sentry OTEL integration has some hacks poking into the client and hard-returning if DSN is None.

I conjecture the hard-return can be removed - the check-DSN-to-avoid-sentry-otel-loops logic still works even without the DSN check in on_start().

Context: we are writing tests for our Sentry integration itself,
setting up a client like

```py
events = []
c = sentry_sdk.Client(dsn=None, instrumenter='otel', transport=events.append)
```

, and verifying that events contains spans from OpenTelemetry such as

```py
with tracer.start_as_current_span('fn'):
   raise Exception('boo')

assert events = [...]
```

This currently doesn't work because the Sentry OTEL integration
has some hacks poking into the client and hard-exiting if DSN is None.

I conjecture this can be removed - the check-DSN-to-avoid-sentry-otel-loops
logic still works even without the DSN check in on_start().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant