xray tracer: set subsegment type for child spans#2
Merged
Conversation
Signed-off-by: Rex Chang <58710378+rexnp@users.noreply.github.com>
rexnp
commented
Dec 15, 2021
| /** | ||
| * Gets this Span's type. | ||
| */ | ||
| const std::string& type() const { return type_; } |
Owner
Author
There was a problem hiding this comment.
I also considered using a boolean isChild to mark a given span, but this works too.
Collaborator
There was a problem hiding this comment.
I think what you have is more flexible.
abaptiste
reviewed
Dec 15, 2021
| // Hex encoded 64 bit identifier | ||
| EXPECT_STREQ("00000000000003e7", s.parent_id().c_str()); | ||
| EXPECT_EQ(expected_->span_name, s.name().c_str()); | ||
| EXPECT_EQ(Subsegment, s.type().c_str()); |
Collaborator
There was a problem hiding this comment.
can we update the test to check that type() is not set for a parent span?
abaptiste
requested changes
Dec 15, 2021
Collaborator
abaptiste
left a comment
There was a problem hiding this comment.
Looks good. Had one minor suggestion.
Signed-off-by: Rex Chang <58710378+rexnp@users.noreply.github.com>
suniltheta
reviewed
Jan 3, 2022
suniltheta
left a comment
There was a problem hiding this comment.
Can you also include a note in docs/root/version_history/current.rst? Probably under Minor Behavior Changes
| @@ -26,6 +26,7 @@ namespace Tracers { | |||
| namespace XRay { | |||
|
|
|||
| constexpr auto XRayTraceHeader = "x-amzn-trace-id"; | |||
There was a problem hiding this comment.
can you change this also to constexpr absl::string_view ?
Merged
rexnp
added a commit
that referenced
this pull request
Mar 2, 2022
* xray tracer: set subsegment type for child spans Signed-off-by: Rex Chang <58710378+rexnp@users.noreply.github.com> * adds test coverage Signed-off-by: Rex Chang <58710378+rexnp@users.noreply.github.com>
rexnp
added a commit
that referenced
this pull request
Mar 2, 2022
Signed-off-by: Rex Chang <58710378+rexnp@users.noreply.github.com> xray tracer: set subsegment type for child spans (#2) * xray tracer: set subsegment type for child spans Signed-off-by: Rex Chang <58710378+rexnp@users.noreply.github.com> * adds test coverage Signed-off-by: Rex Chang <58710378+rexnp@users.noreply.github.com> Xray subsegment (#3) * xray tracer: set subsegment type for child spans Signed-off-by: Rex Chang <58710378+rexnp@users.noreply.github.com> * adds test coverage Signed-off-by: Rex Chang <58710378+rexnp@users.noreply.github.com> * updates xray subsegment name to use operation name (instead of parent's span name) Signed-off-by: Rex Chang <58710378+rexnp@users.noreply.github.com> * updates doc Signed-off-by: Rex Chang <58710378+rexnp@users.noreply.github.com> * updates doc Signed-off-by: Rex Chang <58710378+rexnp@users.noreply.github.com> Xray subsegment (#4) * xray tracer: set subsegment type for child spans Signed-off-by: Rex Chang <58710378+rexnp@users.noreply.github.com> * adds test coverage Signed-off-by: Rex Chang <58710378+rexnp@users.noreply.github.com> * updates xray subsegment name to use operation name (instead of parent's span name) Signed-off-by: Rex Chang <58710378+rexnp@users.noreply.github.com> * updates doc Signed-off-by: Rex Chang <58710378+rexnp@users.noreply.github.com> * updates doc Signed-off-by: Rex Chang <58710378+rexnp@users.noreply.github.com> * adds to spell check dictionary Signed-off-by: Rex Chang <58710378+rexnp@users.noreply.github.com> fixes spellcheck Signed-off-by: Rex Chang <58710378+rexnp@users.noreply.github.com>
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.
Signed-off-by: Rex Chang 58710378+rexnp@users.noreply.github.com
Commit Message: xray tracer: sets the xray segment with type "subsegment" from child spans.
xray doc: https://docs.aws.amazon.com/xray/latest/devguide/xray-api-segmentdocuments.html#api-segmentdocuments-subsegments
Additional Description:
Risk Level: low
Testing: unit test, manual setup verifying new xray behavior
Docs Changes: N/A
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue] aws/aws-app-mesh-roadmap#354
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]
Here's a piece of the output with this change and using the same howto-ecs-basics walkthrough:
in particular looking at the trace with
"name": "howto-ecs-basics/howto-ecs-basics-front-node", which is emitted by Envoy, it now contains a subsegment for the egress call tocds_egress_howto-ecs-basics_howto-ecs-basics-color-node_http_8080. Now, the only thing that remains is the fact that the name of this subsegment is the same as its parenthowto-ecs-basics/howto-ecs-basics-front-node. We'll have to confirm what the intended behavior is.