Support for Lineage in XRay Trace Header and removing additional Baggage from being added#1671
Merged
trask merged 6 commits intoopen-telemetry:mainfrom Feb 18, 2025
Merged
Conversation
Contributor
Author
|
@jack-berg Need additional reviews on the proposed XrayPropagator changes. |
Member
|
hi @liustve, can you sign the CLA? #1671 (comment)
@srprash and @wangzlei are the owners for this component and have already been assigned as reviewers, thanks |
robsunday
reviewed
Feb 5, 2025
|
|
||
| if (xrayLineageHeader.length() < LINEAGE_MIN_LENGTH | ||
| || xrayLineageHeader.length() > LINEAGE_MAX_LENGTH | ||
| || numOfDelimiters != 2) { |
Contributor
There was a problem hiding this comment.
Here a constant would be better as well
| baggage = Baggage.builder(); | ||
| } else if (trimmedPart.startsWith(LINEAGE_KEY)) { | ||
| lineageHeader = parseLineageHeader(value); | ||
| if (isValidLineage(lineageHeader)) { |
Contributor
There was a problem hiding this comment.
It would be worth adding logger.fine printing the value in case parsed lineage is invalid and lineage is not added to the baggage
Contributor
Author
There was a problem hiding this comment.
Sorry for the late reply but comments addressed and implemented.
wangzlei
approved these changes
Feb 17, 2025
liustve
added a commit
to aws-observability/aws-otel-java-instrumentation
that referenced
this pull request
Feb 17, 2025
*Description of changes:* Enabling baggage propagator to support Lineage propagation: open-telemetry/opentelemetry-java-contrib#1671 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
robsunday
approved these changes
Feb 18, 2025
trask
approved these changes
Feb 18, 2025
XinRanZhAWS
pushed a commit
to aws-observability/aws-otel-java-instrumentation
that referenced
this pull request
Mar 11, 2025
*Description of changes:* Enabling baggage propagator to support Lineage propagation: open-telemetry/opentelemetry-java-contrib#1671 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Bug Fix: Current logic for XRay Propagator uses W3C Baggage to inject baggage information to the XRay Trace Header. However, XRay Tracing has a 256 character limit while W3C Baggage has 8192 character limit. This causes part of the baggage to be truncated if it every exceeds 256, causing malformed key-pairs values in the header.
Feature: XRay propagator will still need to use baggage to store Lineage information but we omit adding any sort of additional baggage data to the xray trace header. Instead Baggage context will remain propagated using W3C Baggage.
We do not have to worry about the 256 character limit currently as Lineage is currently using V2 format which has a maximum length of 18 characters.
Anyone using OTel Instrumentation with Xray will have to have both baggage and xray propagators turned on in that order (baggage first then xray).
Existing Issue(s):
Related PR: #1178
Testing:
Unit tests were written to verify that the extraction and injection logic were correct. Older unit tests were deprecated and deleted.
End-to-end testing was done using APIGW, EC2, and Lambda to verify scenarios with services with different instrumentations turned on to ensure the trace header was propagated correctly.