This repository has been archived by the owner on Jul 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 231
Ignores some tags when you create a span with forced sampling #738
Comments
This has been already solved in Go and Node.js Jaeger clients via delayed sampling. It can be implemented in Java as well, of someone has the time. |
Sure, yet that's more effort than just fixing this bug. Would you guys be happy with a PR fixing this specific issue? If yes, which way you guys prefer it to be solved (always put tags in context, check sampling tag before hand)? |
Are you saying that you're supplying SAMPLING_PRIORITY at span creation, but it's still ignoring other tags due to map iteration order? If so, then yes, it sounds like a bug, this specific tag should be processed first. |
AudriusButkevicius
added a commit
to AudriusButkevicius/jaeger-client-java
that referenced
this issue
Aug 28, 2020
AudriusButkevicius
added a commit
to AudriusButkevicius/jaeger-client-java
that referenced
this issue
Aug 28, 2020
AudriusButkevicius
added a commit
to AudriusButkevicius/jaeger-client-java
that referenced
this issue
Aug 28, 2020
AudriusButkevicius
added a commit
to AudriusButkevicius/jaeger-client-java
that referenced
this issue
Aug 28, 2020
yurishkuro
pushed a commit
that referenced
this issue
Aug 28, 2020
# for free
to subscribe to this conversation on GitHub.
Already have an account?
#.
Requirement - what kind of business use case are you trying to solve?
We have an application which we generally do not want tracing enabled, but we have certain user triggered workflows
where we'd like to enable tracing for.
The way we achieve this is for user initiated actions we build a new span (hence context) with
Tags.SAMPLING_PRIORITY
set to1
, together with other tags specific to the users request.Problem - what in Jaeger blocks you from solving the requirement?
There is no specific order in which the tags get processed and added to the context/span, as it's an iteration over a map:
jaeger-client-java/jaeger-core/src/main/java/io/jaegertracing/internal/JaegerSpan.java
Lines 69 to 71 in f1a7ca9
This causes a problem, because tags are only set if the context is sampled
jaeger-client-java/jaeger-core/src/main/java/io/jaegertracing/internal/JaegerSpan.java
Lines 234 to 236 in f1a7ca9
But the decision whether it's sampled or not comes from one of the tags, which can arrive later (due to iteration over a map)
Hence all tags prior to the sampling tag are dropped on the floor and ignored.
Proposal - what do you suggest to solve the problem or improve the existing situation?
I think it should set the tags on the context unconditionally, or explicitly check for the sampling tag and do context adjustments
before setting the rest of the tags.
Sad workaround
Create a noop root span with sampling enabled, create a child span with actual user specific tags
The text was updated successfully, but these errors were encountered: