Skip to content
This repository was archived by the owner on Sep 13, 2022. It is now read-only.

Support false values for the B3 Sampled header#346

Merged
black-adder merged 1 commit intojaegertracing:masterfrom
sebnow:b3-sampled-deny
Feb 19, 2019
Merged

Support false values for the B3 Sampled header#346
black-adder merged 1 commit intojaegertracing:masterfrom
sebnow:b3-sampled-deny

Conversation

@sebnow
Copy link
Copy Markdown
Contributor

@sebnow sebnow commented Feb 19, 2019

Which problem is this PR solving?

The sampling state headers can have three possible values; force sampling, deny sampling, and defer sampling decision. The B3 propagator only looks at the existence of the header, and thus always forces sampling, even when the value is falsy.

An accept sampling decision is encoded as X-B3-Sampled: 1 and a deny as X-B3-Sampled: 0. Absent means defer the decision to the receiver of this header. For example, a Sampled header might look like: X-B3-Sampled: 1.

Note: Before this specification was written, some tracers propagated X-B3-Sampled as true or false as opposed to 1 or 0. While you shouldn't encode X-B3-Sampled as true or false, a lenient implementation may accept them.

https://github.com/openzipkin/b3-propagation#sampling-state-1

Short description of the changes

Check that the value is true before setting the sampling flag.

The sampling state headers can have three possible values; force
sampling, deny sampling, and defer sampling decision. The B3 propagator
only looks at the existence of the header, and thus always forces
sampling, even when the value is falsy.

Check that the value is true before setting the sampling flag.

https://github.com/openzipkin/b3-propagation#sampling-state-1

Signed-off-by: Sebastian Nowicki <[email protected]>
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 19, 2019

Codecov Report

Merging #346 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #346      +/-   ##
==========================================
+ Coverage   99.12%   99.12%   +<.01%     
==========================================
  Files          43       43              
  Lines        1714     1715       +1     
  Branches      336      337       +1     
==========================================
+ Hits         1699     1700       +1     
  Misses         15       15
Impacted Files Coverage Δ
src/propagators/zipkin_b3_text_map_codec.js 98.78% <100%> (+0.01%) ⬆️

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 eb665cd...4ecae6a. Read the comment docs.

@black-adder black-adder merged commit b466a7d into jaegertracing:master Feb 19, 2019
@black-adder
Copy link
Copy Markdown
Contributor

thanks!

Iuriy-Budnikov pushed a commit to agile-pm/jaeger-client-node that referenced this pull request Sep 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants