aws / aws/aws-xray-sdk-python

Support for Cloudwatch logging via trace ID injection

Open
#188 16 comments 2 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
338
Forks
147
PR merge metrics
No merged PRs in 30d

Description

Hi - with the release of ServiceLens (which looks very helpful), I was wondering if you were considering adding trace ID injection somehow? This is required to match Cloudwatch logs to traces in XRay (and thus ServiceLens), see [here](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/deploy_servicelens_CloudWatch_agent_logintegration.html).

This works in the XRay Java SDK by injecting the trace ID into the MDC (see [here](https://docs.aws.amazon.com/xray/latest/devguide//xray-sdk-java-configuration.html#xray-sdk-java-configuration-logging)), which means that each log is given a suffix that includes the trace ID (can then be picked up by the ServiceLens/XRay console to tie traces to logs), e.g. :

`2019-09-10 18:58:30.844 [nio-5000-exec-4] AWS-XRAY-TRACE-ID: 1-5d77f256-19f12e4eaa02e3f76c78f46a WARN 1 - Your logging message here`

Any thoughts on supporting this in the way that the Java SDK does? I don't know much about the MDC but I've only seen it in Java.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.