Skip to content

fix: return early from AddSentryOtlpExporter when DSN is the disable-SDK sentinel#5247

Merged
jamescrosswell merged 1 commit into
mainfrom
fix/5246-disable-sdk-dsn-otlp-escape-hatch
May 21, 2026
Merged

fix: return early from AddSentryOtlpExporter when DSN is the disable-SDK sentinel#5247
jamescrosswell merged 1 commit into
mainfrom
fix/5246-disable-sdk-dsn-otlp-escape-hatch

fix: return early from AddSentryOtlpExporter when DSN is the disable-…

418bf82
Select commit
Loading
Failed to load commit list.
@sentry/warden / warden completed May 20, 2026 in 1m 56s

1 issue

Low

`DidNotReceive().AddInstrumentation(Arg.Any>())` is vacuously true and never verifies the exporter is skipped - `test/Sentry.OpenTelemetry.Exporter.Tests/SentryTracerProviderBuilderExtensionsTests.cs:35`

TracerProviderBuilder.AddInstrumentation is a generic method; NSubstitute only matches AddInstrumentation<object>, never the actual instantiation (AddInstrumentation<BaseProcessor<Activity>>) that AddOtlpExporter produces, so this assertion always passes regardless of whether the exporter was configured. Use DidNotReceiveWithAnyArgs().AddInstrumentation<object>(default!) or assert on AddProcessor to make the check meaningful.

4 skills analyzed
Skill Findings Duration Cost
security-review 0 1.9s $0.04
code-review 0 9.8s $0.05
find-bugs 1 1m 39s $0.27
gha-security-review 0 3.0s $0.02

⏱ 1m 54s · 146.7k in / 7.0k out · $0.39