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
x-datadog-tags propagation and upstream_services tracking #3294
Conversation
66888e2
to
4fffaf5
Compare
@@ -40,7 +40,7 @@ public KafkaConsumerInstrumentation() { | |||
packageName + ".TracingIterator", | |||
packageName + ".TracingList", | |||
packageName + ".TracingListIterator", | |||
packageName + ".Base64Decoder" | |||
"datadog.trace.util.Base64Decoder" // TODO: can be removed when JDK7 is dropped |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to add this now that the class is part of the internal API.
originalString | padding | ||
"" | true | ||
"a" | true | ||
"ab" | true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be good to have some expected output here as well. I once came across a base58check
encoder/decoder that was very good at talking to itself, but wasn't compliant when tested against other encoders/decoders.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea!
9bfa394
to
9a23c3b
Compare
21fe7d5
to
6e81a99
Compare
dd-trace-api/src/main/java/datadog/trace/api/config/TracerConfig.java
Outdated
Show resolved
Hide resolved
Move Base64Decoder to internal-api Introduce Base64Encoder and a test Signed-off-by: Yury Gribkov <yury.gribkov@gmail.com>
…tion. Signed-off-by: Yury Gribkov <yury.gribkov@gmail.com>
Signed-off-by: Yury Gribkov <yury.gribkov@gmail.com>
Signed-off-by: Yury Gribkov <yury.gribkov@gmail.com>
Signed-off-by: Yury Gribkov <yury.gribkov@gmail.com>
Signed-off-by: Yury Gribkov <yury.gribkov@gmail.com>
52606bc
to
bab3479
Compare
@charliegracie I think you're right, according to the RFC: "Customers can disable the propagation of these additional attributes, but it’s enabled by default". I'll change it accordingly. |
Looks like this feature is not required according to the discussion in the RFC document. I'll remove this feature for now then. |
dd-trace-core/src/main/java/datadog/trace/core/propagation/DatadogTags.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was under the impression that when "updating" you append the new decision to the old one. Maybe I misunderstood the RFC but I don't see that happening here
String newServiceName = trace.getTracer().mapServiceName(serviceName); | ||
this.serviceName = newServiceName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this change can be reverted
import static datadog.trace.core.propagation.DatadogHttpCodec.SAMPLING_PRIORITY_KEY | ||
import static datadog.trace.core.propagation.DatadogHttpCodec.SPAN_ID_KEY | ||
import static datadog.trace.core.propagation.DatadogHttpCodec.TRACE_ID_KEY | ||
import static datadog.trace.core.propagation.DatadogHttpCodec.* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like you are missing the intellij config to not make these "*" imports. I set mine to 100 in my config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These imports seemed bulky to me as it imports more than 200 static members, so I wanted to improve it. If it's something that against our code style I'm okay with reverting this change.
DatadogTags implements logic to append a new decision to the propagated ones. When it injects or sends it to the agent it will include any new sampling decision to already propagated upstread_services and possibly other x-datadog-tags. If setSamplingPriority is called for the same service more than once then the last one will kept. Can you please point me to RFC where it states opposite. I'd like to fix it if the current implementation is not aligned with the RFC. |
d2ba595
to
766b56c
Compare
766b56c
to
f9531a5
Compare
f9531a5
to
a33fcf2
Compare
What Does This Do
_dd.p.upstream_services
tag to include the current decision_dd.p.upstream_services
tag from the incoming headers. The tag may not exist or it may have an empty value. Empty values do not need to be propagated. The value will be encoded as described in the RFC document.Currently, if there is no change to
upstream_services
thenx-datadog-tags
will stay untouched and propagated as-is_dd.p.upstream_services
tag and add it to the outgoing headersFor newer endpoints (v06, v07), we set trace tags in Tags of TraceChunk structure.Does dd-trace-java even support v06, v07?
Motivation
[RFC] Trace Tags Propagation in Distributed Traces.
Additional Notes
Implementation plan