Summary
This is a follow-up to #678, which was closed before the actual issue got resolved.
When using the otel integration for tracing, but sentry for exceptions, the sentry middleware always starts a transaction, which is then "invisible" to the otel integration (regardless of middleware ordering; more info in #679) and causes sampling decisions to diverge.
Steps To Reproduce
Initialize otel with:
trace.NewTracerProvider(
trace.WithSampler(trace.AlwaysSample()),
trace.WithSpanProcessor(sentryotel.NewSentrySpanProcessor()),
)
Initialize sentry with:
sentry.ClientOptions{
//...
EnableTracing: true,
TracesSampleRate: 0.0,
//...
}
All traces created with otel.Tracer("").Start() will have span.IsSampled() == true, but none of them will be sent to sentry.
Switching the to NeverSample()/TracesSampleRate: 1.0 causes the opposite problem.
Expected Behavior
Both stacks would agree on sampling.
Environment
SDK
sentry-go version: v0.27.0
- Go version: 1.22
- Using Go Modules? yes
Sentry
- Using hosted Sentry in sentry.io? yes
Summary
This is a follow-up to #678, which was closed before the actual issue got resolved.
When using the otel integration for tracing, but sentry for exceptions, the sentry middleware always starts a transaction, which is then "invisible" to the otel integration (regardless of middleware ordering; more info in #679) and causes sampling decisions to diverge.
Steps To Reproduce
Initialize otel with:
Initialize sentry with:
All traces created with
otel.Tracer("").Start()will havespan.IsSampled() == true, but none of them will be sent to sentry.Switching the to
NeverSample()/TracesSampleRate: 1.0causes the opposite problem.Expected Behavior
Both stacks would agree on sampling.
Environment
SDK
sentry-goversion: v0.27.0Sentry