Skip to content
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

1911 b3 propagator debug flag #2038

Merged

Conversation

jarebudev
Copy link
Contributor

resolves #1911

@codecov
Copy link

codecov bot commented Nov 6, 2020

Codecov Report

Merging #2038 (520b7b0) into master (72c88b6) will increase coverage by 0.99%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2038      +/-   ##
============================================
+ Coverage     84.37%   85.37%   +0.99%     
- Complexity     1879     2029     +150     
============================================
  Files           223      231       +8     
  Lines          7585     7856     +271     
  Branches        808      832      +24     
============================================
+ Hits           6400     6707     +307     
+ Misses          874      840      -34     
+ Partials        311      309       -2     
Impacted Files Coverage Δ Complexity Δ
...etry/extension/trace/propagation/B3Propagator.java 100.00% <100.00%> (ø) 10.00 <1.00> (ø)
...pagation/B3PropagatorExtractorMultipleHeaders.java 100.00% <100.00%> (ø) 8.00 <0.00> (ø)
...propagation/B3PropagatorExtractorSingleHeader.java 96.29% <100.00%> (+0.14%) 10.00 <0.00> (ø)
...opagation/B3PropagatorInjectorMultipleHeaders.java 100.00% <100.00%> (ø) 5.00 <0.00> (+1.00)
.../propagation/B3PropagatorInjectorSingleHeader.java 100.00% <100.00%> (ø) 6.00 <0.00> (+1.00)
...ain/java/io/opentelemetry/api/baggage/Baggage.java 87.50% <0.00%> (-12.50%) 7.00% <0.00%> (-2.00%)
...io/opentelemetry/sdk/metrics/BatchRecorderSdk.java 93.75% <0.00%> (-6.25%) 14.00% <0.00%> (+6.00%) ⬇️
...io/opentelemetry/api/baggage/ImmutableBaggage.java 92.59% <0.00%> (-4.71%) 8.00% <0.00%> (-12.00%)
...lemetry/context/PersistentHashArrayMappedTrie.java 45.45% <0.00%> (-3.64%) 4.00% <0.00%> (ø%)
.../main/java/io/opentelemetry/api/common/Labels.java 94.44% <0.00%> (-1.56%) 11.00% <0.00%> (ø%)
... and 44 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 72c88b6...520b7b0. Read the comment docs.

Copy link
Contributor

@anuraaga anuraaga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the help

jarebudev and others added 2 commits November 8, 2020 20:22
…tension/trace/propagation/B3Propagator.java

Co-authored-by: Anuraag Agrawal <anuraaga@gmail.com>
@@ -26,6 +26,12 @@

String sampled = spanContext.isSampled() ? Common.TRUE_INT : Common.FALSE_INT;

String debug = context.get(B3Propagator.DEBUG_CONTEXT_KEY);
if (!StringUtils.isNullOrEmpty(debug) && debug.contentEquals(Common.TRUE_INT)) {
setter.set(carrier, B3Propagator.DEBUG_HEADER, Common.TRUE_INT);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use the new constant here, MULTI_HEADER_DEBUG?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeh, have changed it/tidied it up.

@@ -26,6 +26,12 @@

String sampled = spanContext.isSampled() ? Common.TRUE_INT : Common.FALSE_INT;

String debug = context.get(B3Propagator.DEBUG_CONTEXT_KEY);
if (!StringUtils.isNullOrEmpty(debug) && debug.contentEquals(Common.TRUE_INT)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Common.TRUE_INT.equals(debug) for this and next file I think

@@ -26,6 +26,11 @@

String sampled = spanContext.isSampled() ? Common.TRUE_INT : Common.FALSE_INT;

if (B3Propagator.MULTI_HEADER_DEBUG.equals(context.get(B3Propagator.DEBUG_CONTEXT_KEY))) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm. In this case, aren't we putting Common.TRUE_INT into the context, not B3Propagator.MULTI_HEADER_DEBUG? They might happen to have the same value at the moment, but I don't think we should confuse the constant from the wire protocol with the constant that we're using internally for propagation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good point - whether the b3 debug was enabled or not is sort of independent of how it was actually modeled in the header, and it might be converted from single to multiple, or vice versa. @jarebudev How about just using a Boolean context value for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeh makes sense. I've changed it to set a boolean, hopefully this sorts it!

Copy link
Contributor

@anuraaga anuraaga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link
Contributor

@jkwatson jkwatson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jkwatson jkwatson merged commit d4583db into open-telemetry:master Nov 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Propagate the B3 debug flag, according to spec
3 participants