-
Notifications
You must be signed in to change notification settings - Fork 848
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
B3 Propagator can't properly handle missing X-B3-Sampled
header
#3517
Comments
Hi @jkwatson, there's another issue with B3 propagation and the
With the OTel Java SDK, the sampling decision is only evaluated if both Trace and Span IDs can be extracted from B3 headers. Thus, OTel-Java is oblivious to external sampling decisions from systems that do not themselves partake in tracing. Lines 33 to 59 in 3518c98
The main use case where I would like to only send the |
Thanks for bringing this up @flangknecht - I agree that we should respect the sampling-decision-only case. Unfortunately our code is quite entangled to the invalid span == no parent span, starting a new trace, so using 0 IDs to represent this would be tough in the SDK too. The only approach I can think of that doesn't cause these spans to participate in other areas, for example logs / exemplar injection (by using valid trace IDs like Does anyone else have any ideas on this? |
Well, exemplar I think already checks whether a span is sampled or not I think. Perhaps it's our logs injection logic which is a bit off, should we be checking sampled instead of invalid? |
As the original issue stated, I think this is a gap in otel's general interop with B3, and needs to be sorted in the specification, so it can be done uniformly across all the languages. |
I think a missing header delegating a sampling decision is a totally foreign concept and definitely needs to be in the spec. An explicit zero is just a compression mechanism though so it seems like it should be simpler. But I guess it's true the main trickiness is treating no span in context identically to invalid span in context, and guess we need to see how to deal with that |
We hit the same issue. From the library's point of view, can you atleast provide a way for users to over-ride the default behavior (of setting it to 0 = not sampled), so that we can set it to an appropriate value ourselves that fits our infra setup. I think it will be very helpful for people inter-operating (and transitioning slowly from b3 -> w3c) and solve compatibility issues in a company with tons of microservices on different versions of spring-boot for e.g. E.g. the proxies usually generates the span/trace ids, but does not send sampling flag to the server. In this case, since a proxy is a given for us, this results into NO tracing at all for us (by default) when we want to support B3 in the input. I have created an issue in spring-boot project which also has a sample project for re-producing the issue - if needed. spring-projects/spring-boot#37994 |
If the
X-B3-Sampled
header is missing, the propagator is considering this as "not sampled" when creating the resulting TraceFlags. This will cause Samplers to then consider the parent as "not sampled" when actually B3 says that this should "leave the decision to the server".I think this might be a bigger issue, however. When propagation is happening in Otel, we only have 2 options: sampled & not-sampled. We don't have a value that represents "you decide".
This might be an issue for the specs and interop with B3.
The text was updated successfully, but these errors were encountered: