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

Xray subsegment #3

Merged
merged 8 commits into from
Mar 2, 2022
Merged

Xray subsegment #3

merged 8 commits into from
Mar 2, 2022

Conversation

rexnp
Copy link
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 and others added 5 commits December 15, 2021 00:18
Signed-off-by: Rex Chang <58710378+rexnp@users.noreply.github.com>
Signed-off-by: Rex Chang <58710378+rexnp@users.noreply.github.com>
…'s span name)

Signed-off-by: Rex Chang <58710378+rexnp@users.noreply.github.com>
Signed-off-by: Rex Chang <58710378+rexnp@users.noreply.github.com>
Signed-off-by: Rex Chang <58710378+rexnp@users.noreply.github.com>
Copy link
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.

Signed-off-by: Rex Chang <58710378+rexnp@users.noreply.github.com>
…bsegment

Signed-off-by: Rex Chang <58710378+rexnp@users.noreply.github.com>
@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 <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>
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>
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