How to setup to consider probability instead of sample flag in traceparent header for web requests #10805
Unanswered
abalabolov
asked this question in
Q&A
Replies: 2 comments
-
|
hi @abalabolov! I'd recommend asking in the micrometer-tracing-bridge-otel project |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Created micrometer-metrics/tracing#626 I didn't find |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Issue: Overwhelm an application with tracing overhead
https://www.w3.org/TR/trace-context-1/#denial-of-service
Env: Spring Boot 3.2.3, micrometer-tracing-bridge-otel + opentelemetry-exporter-zipkin
System: We have desktop, web client and monolitic server (for now) behind AWS ALB with autoscaling.
What I would like to achive:
trace and span idfrom anyWeb clientand take them into account on theBEside for other internal purposes.BEside taking into account specifiedprobabilityon the BE side andSampleFlagheader from theWeb clientside. I.e. to follow this https://www.w3.org/TR/trace-context-1/#trace-flagsI set
tracing.sampling.probability: 0.1and addedAspect(for testing purpose) that wraps several packages with the following code:During startup I see that OTel creates
TraceIdRatioBasedSamplerand wraps it inParentBasedSamplerWhen I specify
traceparent header with sample flag = 01, I face with the following:PropagatingReceiverTracingObservationHandler.onStart()that usesparentTraceContext withPropagatedSpanwithtraceFlags=01`.SpanBuilder.startSpan()hastracerSharedStatewithParentBasedSamplerand callsshouldSample()on behalf ofParentBasedSamplerthat checks traceFlags fromPropagatedSpan. So, it is moreSampleFlagBasedratherparentBasedPropagatedSpan.traceFlags= 01 so the decision isRECORD_AND_SAMPLEevery timetraceparent header with sample flag = 00, then the result isDROPevery time.probabilitydoesn't make an effect. Even I set it to 0 or 0.0, all spans still appear in ZipkinI think this behavior was implemented for comminication between isolated microservices.
So, my questions:
probabilitywork with default out of the box settingsprobabilityinstead ofSampledFlagI am loking for the right way to resolve them and think about one of the following:
Root OTel Samplerwith onlytraceIdRatioBasedsampler. Trusting the following convention: ifSpanis considered to beSampled, other calls to checkshouldSamplewith the same params will return the same result. I have checked, this works as I described above.ParentBasedSampler: remoteParentSampled(Sampler), localParentSampled(Sampler) to TraceIdRatioBasedSampler. Based on the "running the sampler on any child Span will produce the same decision"OncePerRequestfilter and replaceSampleFlag01 to 00 if request is not from some "White list" that is loaded at startup to the memory.W3CTraceContextPropagatorand the same propagators: check if the header is allowed from the caller see option 4).There is a topic that has the similar question but the answer is absent.
open-telemetry/opentelemetry-dotnet#3594
Beta Was this translation helpful? Give feedback.
All reactions