Skip to content

Xray subsegment#3

Merged
rexnp merged 8 commits intomainfrom
xray-subsegment
Mar 2, 2022
Merged

Xray subsegment#3
rexnp merged 8 commits intomainfrom
xray-subsegment

Conversation

@rexnp
Copy link
Copy Markdown
Owner

@rexnp rexnp commented Feb 21, 2022

note: this is a follow up PR to #2. The changes made from previous are:

  1. set child span name to operation name instead of using the parent span's name
  2. updated doc

Commit Message: xray tracer: sets the xray segment with type "subsegment" for 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: added entry in version history under bug fixes
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:]

below is a sample XRay segment traced by the proxy that includes a subsegment calling an upstream. without this change the subsegment would be emitted as a separate segment, which would mess up the XRay service map.

{
            "Id": "8eecc8a82d35c902",
            "Document": {
                "id": "8eecc8a82d35c902",
                "name": "howto-ecs-basics/howto-ecs-basics-front-node",
                "start_time": 1644451809.443302,
                "trace_id": "1-620457e1-47c3587c6ede1c08098a7273",
                "end_time": 1644451809.4465587,
                "parent_id": "257d8a179102651d",
                "http": {
                    "request": {
                        "url": "http://color.howto-ecs-basics.mesh.local:8080/",
                        "method": "GET",
                        "user_agent": "Go-http-client/1.1",
                        "client_ip": "10.0.77.8",
                        "x_forwarded_for": false
                    },
                    "response": {
                        "status": 200,
                        "content_length": 5
                    }
                },
                "aws": {
                    "app_mesh": {
                        "mesh_name": "howto-ecs-basics",
                        "virtual_node_name": "howto-ecs-basics-front-node"
                    }
                },
                "annotations": {
                    "response_flags": "-",
                    "component": "proxy",
                    "upstream_cluster": "cds_egress_howto-ecs-basics_howto-ecs-basics-color-node_http_8080",
                    "request_size": "0",
                    "downstream_cluster": "-",
                    "node_id": "mesh/howto-ecs-basics/virtualNode/howto-ecs-basics-front-node",
                    "direction": "egress"
                },
                "origin": "AWS::AppMesh::Proxy",
                "subsegments": [
                    {
                        "id": "e6badfd202e93ce9",
                        "name": "router cds_egress_howto-ecs-basics_howto-ecs-basics-color-node_http_8080 egress",
                        "start_time": 1644451809.4434495,
                        "end_time": 1644451809.446304,
                        "http": {
                            "request": {},
                            "response": {
                                "status": 200
                            }
                        },
                        "aws": {},
                        "annotations": {
                            "response_flags": "-",
                            "component": "proxy",
                            "upstream_cluster": "cds_egress_howto-ecs-basics_howto-ecs-basics-color-node_http_8080",
                            "upstream_address": "10.0.66.192:8080",
                            "direction": "egress"
                        }
                    }
                ]
            }
        }

@rexnp rexnp requested a review from abaptiste as a code owner February 21, 2022 19:20
Copy link
Copy Markdown
Collaborator

@abaptiste abaptiste left a comment

Choose a reason for hiding this comment

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

LGTM. Made one small suggestion.

@rexnp rexnp merged this pull request into main Mar 2, 2022
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 <[email protected]>

* adds test coverage

Signed-off-by: Rex Chang <[email protected]>

* updates xray subsegment name to use operation name (instead of parent's span name)

Signed-off-by: Rex Chang <[email protected]>

* updates doc

Signed-off-by: Rex Chang <[email protected]>

* updates doc

Signed-off-by: Rex Chang <[email protected]>
rexnp added a commit that referenced this pull request Mar 2, 2022
Signed-off-by: Rex Chang <[email protected]>

xray tracer: set subsegment type for child spans (#2)

* xray tracer: set subsegment type for child spans

Signed-off-by: Rex Chang <[email protected]>

* adds test coverage

Signed-off-by: Rex Chang <[email protected]>

Xray subsegment (#3)

* xray tracer: set subsegment type for child spans

Signed-off-by: Rex Chang <[email protected]>

* adds test coverage

Signed-off-by: Rex Chang <[email protected]>

* updates xray subsegment name to use operation name (instead of parent's span name)

Signed-off-by: Rex Chang <[email protected]>

* updates doc

Signed-off-by: Rex Chang <[email protected]>

* updates doc

Signed-off-by: Rex Chang <[email protected]>

Xray subsegment (#4)

* xray tracer: set subsegment type for child spans

Signed-off-by: Rex Chang <[email protected]>

* adds test coverage

Signed-off-by: Rex Chang <[email protected]>

* updates xray subsegment name to use operation name (instead of parent's span name)

Signed-off-by: Rex Chang <[email protected]>

* updates doc

Signed-off-by: Rex Chang <[email protected]>

* updates doc

Signed-off-by: Rex Chang <[email protected]>

* adds to spell check dictionary

Signed-off-by: Rex Chang <[email protected]>

fixes spellcheck

Signed-off-by: Rex Chang <[email protected]>
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