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

[Lambda] Create dummy segment when trace header is incomplete #429

Merged
merged 2 commits into from
May 8, 2024

Conversation

majanjua-amzn
Copy link
Contributor

When using Lambda, if there is no trace header or an invalid one we would like to send a NoOp segment instead of a Facade segment so that customers can call X-Ray SDK APIs and utilize X-Ray SDK without any output. This will not send data to X-Ray nor inject X-Ray trace headers downstream.

Description of changes:

  • When initializing the context, create a dummy segment if the trace header is incomplete
  • Appropriately identify when the created segment is a dummy and handle it accordingly ( or isinstance(current_entity, DummySegment))
  • Update comments and tests accordingly

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@majanjua-amzn majanjua-amzn requested a review from a team as a code owner May 7, 2024 21:20
This change makes it so that when the trace header is incomplete no new subsegments will be added. Customers can call the X-Ray SDK APIs without any output in this case.
@wangzlei
Copy link
Contributor

wangzlei commented May 8, 2024

Do we have a unit test cover the trace header "Root=x;Lineage=y" case in Lambda enviroment?

@wangzlei wangzlei merged commit 164b3bb into aws:master May 8, 2024
7 of 12 checks passed
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.

2 participants