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

add xray sdk language and version in subsegment from Lambda environment #406

Closed
wants to merge 1 commit into from
Closed

Conversation

wangzlei
Copy link
Contributor

@wangzlei wangzlei commented Jun 14, 2024

Issue #, if available:
X-Ray Segments have X-Ray SDK and version information in field aws: {xray {}}(refer to code), but in AWS Lambda environment there is only Subsegment can be generated. Customer does not know the xray sdk version by checking trace from xray console.

Description of changes:
Appending xray sdk info into the first subsegment generated in each Lambda invocation.

     aws": {
                    "xray": {
                        "sdk_version": "2.16.0",
                        "sdk": "X-Ray for Java"
                    }
                },

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

@wangzlei wangzlei requested a review from a team as a code owner June 14, 2024 00:14
@wangzlei wangzlei changed the title add xray sdk language and version in subsegment in Lambda environment add xray sdk language and version in subsegment from Lambda environment Jun 14, 2024
@@ -80,6 +80,7 @@ public Subsegment beginSubsegment(AWSXRayRecorder recorder, String name) {
? new SubsegmentImpl(recorder, name, parentSegment)
: Subsegment.noOp(parentSegment, recorder);
subsegment.setParent(parentSegment);
subsegment.putAllAws(recorder.getAwsRuntimeContext());
Copy link
Contributor

Choose a reason for hiding this comment

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

If user creates multiple "root subsegments", looks like each will have a copy of this information.
Do we want only one of the subsegments to have this information?
I don't know which is more reasonable: one or all subsegments with this data.

Copy link
Contributor

Choose a reason for hiding this comment

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

We are adding this information to all subsegments and not just "root subsegments" (not sure @jj22ee what you mean by this), right?
So it seem redundant to add same information to all the subsegments. Can we possibly add this to the segment created by Lambda runtime?

@wangzlei wangzlei closed this by deleting the head repository Jul 12, 2024
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.

3 participants