-
Notifications
You must be signed in to change notification settings - Fork 25
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
Bug: AWS X-Ray tracing: remote subsegments should name the remote service, not the local service #354
Comments
For some reason when I am testing I am not seeing subsegments from App Mesh Proxy. I see two independent segments for ingress and egress. @GrahamLea can you confirm if this is what you are seeing. Below is an example trace using https://github.com/kiranmeduri/aws-app-mesh-examples/tree/howto-ecs-basics "Id": "1-611ef56c-3e5b732747131c467377229b",
"Duration": 0.004,
"LimitExceeded": false,
"Segments": [
{
"Id": "643a5eba72e10b45",
"Document": {
"id": "643a5eba72e10b45",
"name": "color",
"start_time": 1629418860.6141655,
"trace_id": "1-611ef56c-3e5b732747131c467377229b",
"end_time": 1629418860.6142209,
"parent_id": "e231bf85c88a176c",
"http": {
"request": {
"url": "/",
"method": "GET",
"user_agent": "Go-http-client/1.1",
"client_ip": "127.0.0.1:50750"
},
"response": {
"status": 200
}
}
}
},
{
"Id": "e231bf85c88a176c",
"Document": {
"id": "e231bf85c88a176c",
"name": "howto-ecs-basics/howto-ecs-basics-color-node",
"start_time": 1629418860.613789,
"trace_id": "1-611ef56c-3e5b732747131c467377229b",
"end_time": 1629418860.6146402,
"parent_id": "a435624f881b0676",
"http": {
"request": {
"url": "http://color.howto-ecs-basics.mesh.local:8080/",
"method": "GET",
"user_agent": "Go-http-client/1.1",
"client_ip": "10.0.70.160",
"x_forwarded_for": false
},
"response": {
"status": 200,
"content_length": 5
}
},
"aws": {
"app_mesh": {
"mesh_name": "howto-ecs-basics",
"virtual_node_name": "howto-ecs-basics-color-node"
}
},
"annotations": {
"response_flags": "-",
"component": "proxy",
"upstream_cluster": "cds_ingress_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-color-node"
},
"origin": "AWS::AppMesh::Proxy"
}
},
{
"Id": "a435624f881b0676",
"Document": {
"id": "a435624f881b0676",
"name": "howto-ecs-basics/howto-ecs-basics-front-node",
"start_time": 1629418860.613093,
"trace_id": "1-611ef56c-3e5b732747131c467377229b",
"end_time": 1629418860.6155586,
"parent_id": "f1db8af9fc1ba721",
"http": {
"request": {
"url": "http://color.howto-ecs-basics.mesh.local:8080/",
"method": "GET",
"user_agent": "Go-http-client/1.1",
"client_ip": "10.0.70.160",
"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",
"downstream_cluster": "-",
"request_size": "0",
"node_id": "mesh/howto-ecs-basics/virtualNode/howto-ecs-basics-front-node"
},
"origin": "AWS::AppMesh::Proxy"
}
},
{
"Id": "b2ebdad055907d25",
"Document": {
"id": "b2ebdad055907d25",
"name": "front",
"start_time": 1629418860.6127875,
"trace_id": "1-611ef56c-3e5b732747131c467377229b",
"end_time": 1629418860.6159291,
"parent_id": "20e2fa1ed7df8cbd",
"http": {
"request": {
"url": "/color",
"method": "GET",
"user_agent": "curl/7.64.1",
"client_ip": "205.251.233.52",
"x_forwarded_for": true
},
"response": {
"status": 200
}
},
"subsegments": [
{
"id": "f1db8af9fc1ba721",
"name": "color.howto-ecs-basics.mesh.local:8080",
"start_time": 1629418860.6128187,
"end_time": 1629418860.6158834,
"http": {
"request": {
"url": "http://color.howto-ecs-basics.mesh.local:8080",
"method": "GET"
},
"response": {
"status": 200,
"content_length": 5
}
},
"namespace": "remote",
"subsegments": [
{
"id": "17c8b14277300637",
"name": "request",
"start_time": 1629418860.612922,
"end_time": 1629418860.6129484
},
{
"id": "bde5b81609785fc1",
"name": "response",
"start_time": 1629418860.6129577,
"end_time": 1629418860.6158335
}
]
}
]
}
},
{
"Id": "20e2fa1ed7df8cbd",
"Document": {
"id": "20e2fa1ed7df8cbd",
"name": "howto-ecs-basics/howto-ecs-basics-front-node",
"start_time": 1629418860.6123674,
"trace_id": "1-611ef56c-3e5b732747131c467377229b",
"end_time": 1629418860.616197,
"http": {
"request": {
"url": "http://appme-publi-2egemd7ho73v-1851548281.us-west-2.elb.amazonaws.com/color",
"method": "GET",
"user_agent": "curl/7.64.1",
"client_ip": "10.0.49.69",
"x_forwarded_for": false
},
"response": {
"status": 200,
"content_length": 39
}
},
"aws": {
"app_mesh": {
"mesh_name": "howto-ecs-basics",
"virtual_node_name": "howto-ecs-basics-front-node"
}
},
"annotations": {
"response_flags": "-",
"component": "proxy",
"upstream_cluster": "cds_ingress_howto-ecs-basics_howto-ecs-basics-front-node_http_8080",
"request_size": "0",
"downstream_cluster": "-",
"node_id": "mesh/howto-ecs-basics/virtualNode/howto-ecs-basics-front-node"
},
"origin": "AWS::AppMesh::Proxy"
}
}
]
} |
@abaptiste @lavignes can you confirm if this is right behavior? I think marking the segment as ingress or egress is useful. But not sure if subsegments make sense unless we have richer instrumentation in Envoy such as RDS/CDS/EDS processing. |
Hey, thanks for picking this up, Kiran.
And here's the egress segment on another service's proxy that is the parent of the one above:
(We can tell the latter is an egress bc the request URL is for a different service to the So, it seems my opening sentence:
...is not represented in the data I've looked at today. The proxies are logging subsegments for calls into their own services rather than out to other services. Two thoughts, having looked at this now: Subsegments Service Names Hope that's helpful! |
@GrahamLea sorry for the delay. If I can trouble you once more, can you let me know which version of Envoy you are using? Thanks |
Sorry, this was from a client's system, so I don't have that information. |
After spelunking through Envoy and the X-ray extension, it does not appear that the X-ray extension creates or updates the |
Another update, the The tracer does create child spans which are equivalent. There is a Here's a link to the existing tracer fields where we can begin adjusting the span content. |
An update on this issue: we've identified the necessary changes to trace remote calls as a subsegment and have the subsegment name be identified as the remote service (instead of the caller's).
To demonstrate, this gap is most noticeable in the XRay service map (the graphs below are captured from App Mesh & Xray integration walkthrough): The service map above shows the outcome of simply enabling the Envoy while having segment details about the remote service, e.g.
Therefore, today we do not want to simply enable the trace remote call option in Envoy for customers without also having them upgrade their Envoy image with the Xray extension fix. Path forward:
I will update back when 1) is complete. |
This fix envoyproxy/envoy#20170 is merged in Envoy github repo. This fix should be available from next version v1.22.x App Mesh envoy image release. |
This capability is added in envoyproxy v1.22 release and should be available from We shall keep this issue open so that customers can discover this capability and cut us a ticket. |
Summary
App Mesh Proxies can log segment documents to AWS X-Ray that include subsegments that record calls out to other services. In these subsegments, the
name
field is the same as thename
used for the proxy's own segment, but it should instead name the downstream service being contacted. From the AWS docs on the Segment document format:While this is a somewhat minor issue, it affects tooling which makes use of data from X-Ray and expects it to conform to the documented format.
Steps to Reproduce
Set up App Mesh proxy tracing to AWS X-Ray. Look at the raw data of a trace and inspect the names of
remote
subsegments.Are you currently working around this issue?
The information that should be in the
name
property can often be gleaned from thehttp.request.url
property, but this is not straightforward.The text was updated successfully, but these errors were encountered: