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

Fix B3 propagator and add tests #882

Merged
merged 38 commits into from
Jul 7, 2020
Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
5efea1c
Correct B3 propagators and add tests
MrAlias Jul 1, 2020
5b14cc4
Break up external integration and internal unit tests
MrAlias Jul 1, 2020
08e9a40
Merge remote-tracking branch 'upstream/master' into b3-header-tests
MrAlias Jul 1, 2020
0a7a3fa
Add changes to Changelog.
MrAlias Jul 1, 2020
a89f8e6
Update Changelog with PR number
MrAlias Jul 1, 2020
bda1e3e
Fix lint issues
MrAlias Jul 1, 2020
f16dc0c
Update trace flags
MrAlias Jul 1, 2020
a96d02f
Update extractSingle to support unset sampling
MrAlias Jul 1, 2020
6c6a7b2
Update existing tests to appropriately use FlagsUnset
MrAlias Jul 1, 2020
405be1a
Remove bogus debug flag test
MrAlias Jul 1, 2020
be56698
B3 Extract now supports parsing both headers
MrAlias Jul 1, 2020
e7d5ed7
Feedback
MrAlias Jul 1, 2020
16e4bc1
Merge remote-tracking branch 'upstream/master' into b3-header-tests
MrAlias Jul 1, 2020
3f1ea36
Switch to bitmask inject encoding field
MrAlias Jul 1, 2020
614e3c1
Add comments
MrAlias Jul 1, 2020
10c345b
Migrate B3 integration tests to existing testtrace
MrAlias Jul 2, 2020
2c37f31
Merge branch 'master' into b3-header-tests
MrAlias Jul 2, 2020
727af41
Update comment
MrAlias Jul 2, 2020
22c4a48
Benchmark invalid B3 injects as well
MrAlias Jul 2, 2020
b6a2a14
Update trace flags
MrAlias Jul 2, 2020
712f879
Revert SpanContext.IsSampled back
MrAlias Jul 2, 2020
49335f9
Add comment to b3 test data generation
MrAlias Jul 2, 2020
ee571de
Update Changelog
MrAlias Jul 2, 2020
b2f3075
Fix trace flag name in Changelog
MrAlias Jul 2, 2020
6b44a10
Fix Changelog formatting
MrAlias Jul 2, 2020
3f92d8c
Update Changelog
MrAlias Jul 2, 2020
b178c20
Remove valid check at start of B3 injectg
MrAlias Jul 2, 2020
e882f6f
Update B3 inject integration tests
MrAlias Jul 2, 2020
f7d73cd
Update B3 integration tests
MrAlias Jul 2, 2020
10b8832
Rename injectTest parentSc to sc
MrAlias Jul 2, 2020
5deb387
Update GetAllKeys for B3
MrAlias Jul 2, 2020
e2868bd
Merge remote-tracking branch 'upstream/master' into b3-header-tests
MrAlias Jul 7, 2020
8651a69
Un-Export the B3 headers
MrAlias Jul 7, 2020
ee9c266
Rename B3 encodings and move support method to B3Encoding
MrAlias Jul 7, 2020
68e60e8
Update span_context_test tests
MrAlias Jul 7, 2020
57c6669
Use named const for Single Header decoding widths
MrAlias Jul 7, 2020
79be791
Update api/trace/b3_propagator.go
MrAlias Jul 7, 2020
cc5dae2
Merge branch 'master' into b3-header-tests
MrAlias Jul 7, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

### Added

- The `B3Encoding` type to represent the B3 encoding(s) the B3 propagator can inject.
A value for HTTP supported encodings (Multiple Header: `MultipleHeader`, Single Header: `SingleHeader`) are included. (#882)
- The `FlagsDeferred` trace flag to indicate if the trace sampling decision has been deferred. (#882)
- The `FlagsDebug` trace flag to indicate if the trace is a debug trace. (#882)
- Add `peer.service` semantic attribute. (#898)
- Add database-specific semantic attributes. (#899)
- Add semantic convention for `faas.coldstart` and `container.id`. (#909)
Expand All @@ -18,10 +22,28 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

- Update `CONTRIBUTING.md` to ask for updates to `CHANGELOG.md` with each pull request. (#879)
- Use lowercase header names for B3 Multiple Headers. (#881)
- The B3 propagator `SingleHeader` field has been replaced with `InjectEncoding`.
This new field can be set to combinations of the `B3Encoding` bitmasks and will inject trace information in these encodings.
If no encoding is set, the propagator will default to `MultipleHeader` encoding. (#882)
- The B3 propagator now extracts from either HTTP encoding of B3 (Single Header or Multiple Header) based on what is contained in the header.
Preference is given to Single Header encoding with Multiple Header being the fallback if Single Header is not found or is invalid.
This behavior change is made to dynamically support all correctly encoded traces received instead of having to guess the expected encoding prior to receiving. (#882)

### Removed

- The `FlagsUnused` trace flag is removed.
The purpose of this flag was to act as the inverse of `FlagsSampled`, the inverse of `FlagsSampled` is used instead. (#882)
- The B3 header constants (`B3SingleHeader`, `B3DebugFlagHeader`, `B3TraceIDHeader`, `B3SpanIDHeader`, `B3SampledHeader`, `B3ParentSpanIDHeader`) are removed.
If B3 header keys are needed [the authoritative OpenZipkin package constants](https://pkg.go.dev/github.com/openzipkin/zipkin-go@v0.2.2/propagation/b3?tab=doc#pkg-constants) should be used instead. (#882)

### Fixed

- The B3 Single Header name is now correctly `b3` instead of the previous `X-B3`. (#881)
- The B3 propagator now correctly supports sampling only values (`b3: 0`, `b3: 1`, or `b3: d`) for a Single B3 Header. (#882)
- The B3 propagator now propagates the debug flag.
This removes the behavior of changing the debug flag into a set sampling bit.
Instead, this now follow the B3 specification and omits the `X-B3-Sampling` header. (#882)
- The B3 propagator now tracks "unset" sampling state (meaning "defer the decision") and does not set the `X-B3-Sampling` header when injecting. (#882)
- Ensure span status is not set to `Unknown` when no HTTP status code is provided as it is assumed to be `200 OK`. (#908)
- Ensure `httptrace.clientTracer` closes `http.headers` span. (#912)

Expand Down
Loading