Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Do not encode span context in HTTP_HEADERS format #721

Merged
merged 1 commit into from
Jun 26, 2020

Conversation

cykl
Copy link
Contributor

@cykl cykl commented Jun 26, 2020

Which problem is this PR solving?

String representation of a span context is safe to use in HTTP header. Thus, there is no need to encode it. JS & Go clients
already avoid that unnecessary encoding.

Resolves #720

Short description of the changes

This change is backward compatible because all clients unencode span context even if they do not encode it. More pragmatically, a client impacted by this change would already be incompatible with JS & Go clients.

@codecov
Copy link

codecov bot commented Jun 26, 2020

Codecov Report

Merging #721 into master will decrease coverage by 0.92%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #721      +/-   ##
============================================
- Coverage     89.78%   88.85%   -0.93%     
- Complexity      590      595       +5     
============================================
  Files            70       72       +2     
  Lines          2164     2199      +35     
  Branches        284      287       +3     
============================================
+ Hits           1943     1954      +11     
- Misses          132      153      +21     
- Partials         89       92       +3     
Impacted Files Coverage Δ Complexity Δ
...egertracing/internal/propagation/TextMapCodec.java 92.72% <100.00%> (-1.82%) 35.00 <2.00> (-1.00)
...a/io/jaegertracing/internal/clock/SystemClock.java 75.00% <0.00%> (-25.00%) 6.00% <0.00%> (+2.00%) ⬇️
...gertracing/internal/clock/MicrosAccurateClock.java 0.00% <0.00%> (ø) 0.00% <0.00%> (?%)
...ertracing/internal/clock/MillisAccurrateClock.java 100.00% <0.00%> (ø) 4.00% <0.00%> (?%)
...n/java/io/jaegertracing/internal/JaegerTracer.java 89.22% <0.00%> (+0.14%) 27.00% <0.00%> (ø%)

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 5831d9e...71b3e03. Read the comment docs.

}

@Test
public void testExtractSupportEncodedSpanContext() {
Copy link
Member

Choose a reason for hiding this comment

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

I think this and next method names should be swapped

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, fixed.

We know that string representation of a span context is safe to use in
HTTP header. Thus, there is no need to encode it. JS & Go clients
already avoid that unnecesserary encoding. This change is backward
compatible because all clients unencode span context even if they do not
encode it. More pragmatically, a client impacted by this change would
already be incompatible with JS & Go clients.

Signed-off-by: Clément MATHIEU <clement@unportant.info>
@cykl cykl force-pushed the do_not_encode_span_context branch from 1c918e7 to 71b3e03 Compare June 26, 2020 18:29
Copy link
Member

@yurishkuro yurishkuro 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 patch!

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Do not URL-encode uber-trace-id headerr
2 participants