You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The decision from the otel sampler is ignored by sentry, which then samples again based on its own logic, leaving the otel and sentry samplig decisions disconnected.
Using onlysentry.ClientOptions.TracesSampler is not an option for similar reasons: its decision does not get passed back to otel, so otel's Span.IsSampled() returns an unrelated value to sentry's decision (so that you end up - e.g. - using a traceID in exemplars and logs that never actually got sent to sentry, or the other way around).
The otel and sentry sides seem to agree in the case where a parent span could be found.
Summary
Currently, using something like the following seems to lead to unexpected results:
The decision from the otel sampler is ignored by sentry, which then samples again based on its own logic, leaving the otel and sentry samplig decisions disconnected.
Using only
sentry.ClientOptions.TracesSampler
is not an option for similar reasons: its decision does not get passed back to otel, so otel'sSpan.IsSampled()
returns an unrelated value to sentry's decision (so that you end up - e.g. - using a traceID in exemplars and logs that never actually got sent to sentry, or the other way around).The otel and sentry sides seem to agree in the case where a parent span could be found.
Am I holding it wrong? 😅
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.0
causes the opposite problem.Expected Behavior
Sentry should respect OTel's
span.IsSampled()
and only sample trances if and only if it is true.(The other way around seems a bit more difficult to pull off?)
Environment
SDK
sentry-go
0.22.0:Sentry
Additional context
The text was updated successfully, but these errors were encountered: