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
{{ message }}
Repository navigation
'sampling_rate' and 'xray_trace_id' cannot be suppressed #215
Thanks for the useful tools.
I use aws-lambda-powertools-python in Lambda python 3.8.
for document
Logger allows you to either change the format or suppress the following keys altogether at the initialization: location, timestamp, level, xray_trace_id, and datefmt
but I can't suppress the 'sampling_rate' and 'xray_trace_id'
(Is it a specification that 'sampling_rate' cannot be suppressed?)
I want to suppress the 'sampling_rate' and 'xray_trace_id'.
Sampling rate is part of the spec and as you noticed cannot be suppressed.
For X-Ray, it is automatically suppressed if X-Ray isn't enabled for the function. When X-Ray is enabled, this log entry allows CloudWatch Service Lens to combine Logs, Metrics and Traces in one page.
Aside for sampling rate, may I ask why you'd like to suppress X-Ray Trace ID field despite enabling it in the function?
I believe the docs can be clearer on that, so I'll amend it later :)
Sampling rate is part of the spec and as you noticed cannot be suppressed.
For X-Ray, it is automatically suppressed if X-Ray isn't enabled for the function. When X-Ray is enabled, this log entry allows CloudWatch Service Lens to combine Logs, Metrics and Traces in one page.
Well, I see.
Aside for sampling rate, may I ask why you'd like to suppress X-Ray Trace ID field despite enabling it in the function?
So far I've been using x-ray-ids in the cloudwatch log report to do surveys, etc., but I've never found it very inconvenient.
So I wondered if it was not necessary to add x-ray-ids to all Logger logs.
Activity
heitorlessa commentedon Nov 22, 2020
Hey Hiroya, thanks for opening up an issue.
Sampling rate is part of the spec and as you noticed cannot be suppressed.
For X-Ray, it is automatically suppressed if X-Ray isn't enabled for the function. When X-Ray is enabled, this log entry allows CloudWatch Service Lens to combine Logs, Metrics and Traces in one page.
Aside for sampling rate, may I ask why you'd like to suppress X-Ray Trace ID field despite enabling it in the function?
I believe the docs can be clearer on that, so I'll amend it later :)
Thanks
papi-tokei commentedon Nov 23, 2020
Hello Heitor.
Thanks for replying in detail.
Well, I see.
So far I've been using x-ray-ids in the cloudwatch log report to do surveys, etc., but I've never found it very inconvenient.
So I wondered if it was not necessary to add x-ray-ids to all Logger logs.
papi-tokei commentedon Nov 23, 2020
Let the issue be resolved this time.
It would be helpful if you could create a separate issue for the documentation modifications
heitorlessa commentedon Nov 24, 2020
Just created an issue to track doc updates for this - Thanks a lot for flagging it @papi-tokei, much appreciated.
heitorlessa commentedon Nov 27, 2020
@papi-tokei letting you know that this is now live in the docs :) We appreciate your feedback very much on helping us improve the docs
papi-tokei commentedon Nov 27, 2020
@heitorlessa
Thank you for your kindness
(^▽^)