fix: return early from AddSentryOtlpExporter when DSN is the disable-SDK sentinel#5247
Merged
Merged
Conversation
…SDK sentinel When the caller passes `SentryConstants.DisableSdkDsnValue` (empty string) to `AddSentryOtlpExporter`, we now short-circuit before attempting to parse it as a real DSN. This prevents a spurious `ArgumentException` when the SDK is intentionally disabled. Fixes #5246 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: James Crosswell <james.crosswell@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5247 +/- ##
==========================================
- Coverage 74.12% 74.11% -0.02%
==========================================
Files 508 508
Lines 18318 18320 +2
Branches 3583 3584 +1
==========================================
- Hits 13579 13577 -2
- Misses 3864 3871 +7
+ Partials 875 872 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
dingsdax
approved these changes
May 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When a caller passes
SentryConstants.DisableSdkDsnValue(empty string"") toAddSentryOtlpExporter, the method previously threw an exception rather than disabling the integration.SentryConstants.DisableSdkDsnValueis a valid DSN value and should be handled gracefully.Dsn.IsDisabled(dsnString)before the existing DSN validation, so disabled-SDK callers get back the builder unchanged.Fixes #5246