Repository navigation
fix(logger): strip xray_trace_id when explicitly disabled - #2852
Conversation
Signed-off-by: heitorlessa <lessa@amazon.co.uk>
Signed-off-by: heitorlessa <lessa@amazon.co.uk>
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## develop #2852 +/- ##
========================================
Coverage 97.57% 97.57%
========================================
Files 162 162
Lines 7473 7475 +2
Branches 1416 1416
========================================
+ Hits 7292 7294 +2
Misses 133 133
Partials 48 48
☔ View full report in Codecov by Sentry. |
leandrodamascena
left a comment
There was a problem hiding this comment.
Hei @heitorlessa! I tried to find information about this parameter xray_trace_id in our documentation and I couldn't find. Should we add a section or banner in the Advanced section to explain this?
|
It's documented under Overriding Log Record: https://docs.powertools.aws.dev/lambda/python/latest/core/logger/#overriding-log-records
|
|
Kudos, SonarCloud Quality Gate passed!
|









Issue number: #2835
Summary
This PR addresses the issue of X-Ray Trace ID key (
xray_trace_id) not being removed despite being explicitly disabled.Changes
User experience
Setting X-Ray Trace ID env var produces no effect when explicitly disabling at
Loggerconstructor (as expected now)_X_AMZN_TRACE_ID="Root=1-5759e988-bd862e3fe1be46a994272793;Parent=53995c3f42cd8ad8;Sampled=1" python bla.pyOutput
{ "level": "INFO", "location": "<module>:4", "message": "blah", "timestamp": "2023-07-26 14:17:53,765+0200", "service": "service_undefined" }Checklist
If your change doesn't seem to apply, please leave them unchecked.
Is this a breaking change?
RFC issue number:
Checklist:
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.