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

OpenTelemetry integration throws an exception when Sentry is disabled #3156

Merged
merged 10 commits into from
Feb 19, 2024

Conversation

jamescrosswell
Copy link
Collaborator

@jamescrosswell jamescrosswell commented Feb 19, 2024

Fixes #3155

Ultimately I've fixed this in the TraceProviderBuilderExtensions:

return hub.IsEnabled
? new SentrySpanProcessor(hub, enrichers)
: DisabledSpanProcessor.Instance;

I also refactored those slighly for testability.

Note

We didn't pick up on this because we configure the DSN via an attribute in our sample projects... so even if you tried to force the DSN to be disabled when using our Otel sample, it would use a Valid DSN 😢

<ItemGroup>
<SentryAttributes Include="Sentry.DsnAttribute">
<_Parameter1>https://eb18e953812b41c3aeb042e666fd3b5c@o447951.ingest.sentry.io/5428537</_Parameter1>
</SentryAttributes>
</ItemGroup>

@bitsandfoxes
Copy link
Contributor

We didn't pick up on this because we configure the DSN via an attribute in our sample projects...

Maybe it's time to remove the attribute again? I wasn't even aware we were doing this until last week and ran headfirst into a wall with the assumption that we don't.

CHANGELOG.md Outdated Show resolved Hide resolved
bitsandfoxes
bitsandfoxes previously approved these changes Feb 19, 2024
Copy link
Contributor

@bitsandfoxes bitsandfoxes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@jamescrosswell
Copy link
Collaborator Author

Maybe it's time to remove the attribute again? I wasn't even aware we were doing this until last week and ran headfirst into a wall with the assumption that we don't.

Yeah I think we can always set an environment variable if we want/need... I'm OK with removing it. Separate PR for that maybe?

@jamescrosswell jamescrosswell merged commit 818e404 into main Feb 19, 2024
30 checks passed
@jamescrosswell jamescrosswell deleted the fix/otel-getsentryoptions branch February 19, 2024 20:17
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.

OpenTelemetry integration throws when Sentry is disabled
3 participants