You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you look at Traces in AWS CloudWatch, the Log section looks like this:
But if you click through to "View in CloudWatch Logs Insights` then apply the correct log-group it finds the appropriate logs, meaning the tracing header is being correctly set.
The X-Ray docs show that there is an aws field in the protocol of which only the xray part of this is filled in currently.
After investigation the aws field I see there are two fields cloudwatch_logs that are not populated. Luckily I know that an ECS instance has access to the ECS_CONTAINER_METADATA_URI_V4 endpoint.
When called from within an ECS instance in Far-gate, this responds with JSON in the following structure
This endpoint includes enough information to fill in the cloudwatch_logs.group_name field via the awslogs-group field. I put together a branch here doing this.
cloudwatch_logs however requires two fields. log_group and arn. The problem is that whilst ECS_CONTAINER_METADATA_URI_V4 contains the awslogs-group, it does not contain the arn. It is very likely to be the same as the Labels['com.amazonaws.ecs.cluster'], which I use to calculate it in my branch which is successful.
However, my method for calculating the ARN from the cluster's ARN wouldn't if the logs were in a different account or region as the cluster. So I'm able to fill the Cloudwatch logs correctly with the logs, but this wouldn't work for some scenarios. One of two actions would fix this issue:
Could the ECS_CONTAINER_METADATA_URI_V4 endpoint be updated to pass through the full ARN of the target log so it could be passed via X-Ray and used in CloudWatch Traces?
Could the CloudWatch front-end be updated to handle only the log_group by itself? The front-end attempts to read a log-group by name if the arn isn't provided, or use the arn if it is.
Many thanks
Tom
The text was updated successfully, but these errors were encountered:
Hi all
When you look at Traces in AWS CloudWatch, the Log section looks like this:
But if you click through to "View in CloudWatch Logs Insights` then apply the correct log-group it finds the appropriate logs, meaning the tracing header is being correctly set.
The X-Ray docs show that there is an
aws
field in the protocol of which only thexray
part of this is filled in currently.After investigation the
aws
field I see there are two fieldscloudwatch_logs
that are not populated. Luckily I know that an ECS instance has access to theECS_CONTAINER_METADATA_URI_V4
endpoint.When called from within an ECS instance in Far-gate, this responds with JSON in the following structure
This endpoint includes enough information to fill in the
cloudwatch_logs.group_name
field via theawslogs-group
field. I put together a branch here doing this.cloudwatch_logs
however requires two fields.log_group
andarn
. The problem is that whilstECS_CONTAINER_METADATA_URI_V4
contains theawslogs-group
, it does not contain thearn
. It is very likely to be the same as theLabels['com.amazonaws.ecs.cluster']
, which I use to calculate it in my branch which is successful.However, my method for calculating the ARN from the cluster's ARN wouldn't if the logs were in a different account or region as the cluster. So I'm able to fill the Cloudwatch logs correctly with the logs, but this wouldn't work for some scenarios. One of two actions would fix this issue:
Could the
ECS_CONTAINER_METADATA_URI_V4
endpoint be updated to pass through the full ARN of the target log so it could be passed via X-Ray and used in CloudWatch Traces?Could the CloudWatch front-end be updated to handle only the
log_group
by itself? The front-end attempts to read a log-group by name if thearn
isn't provided, or use thearn
if it is.Many thanks
Tom
The text was updated successfully, but these errors were encountered: