-
Notifications
You must be signed in to change notification settings - Fork 410
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
feat(logger): add new logic to sample debug logs #6142
base: develop
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #6142 +/- ##
========================================
Coverage 96.25% 96.25%
========================================
Files 236 236
Lines 11399 11407 +8
Branches 828 830 +2
========================================
+ Hits 10972 10980 +8
Misses 337 337
Partials 90 90 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
APPROVED
Hey Ana! I'm dismissing the review because I'll need to change the documentation.
Hey @dreamorosi! Pls I'd like a review in the documentation part. Thanks |
cc @am29d - FYI we can lift the doc updates for the feature in our own PR. |
Thanks @dreamorosi! I've incorporated all your suggestions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this and addressing the comments.
great work |
|
Hey @dreamorosi! I need your review here again. |
Issue number: #6141
Summary
This PR improves the log sampling rate calculation mechanism in our Logger utility. It aims to provide a more consistent and expected behavior for customers using log sampling, especially when reusing Lambda environments.
Changes
refresh_sample_rate_calculation()
in the Logger class.@logger.inject_lambda_context
decorator to callrefresh_sample_rate_calculation()
at the end of each invocation.Expected Behavior
sampling_rate
at the constructor level.@logger.inject_lambda_context
, the sampling rate will be recalculated on every request, providing the expected sampling behavior.refresh_sample_rate_calculation()
to achieve the same effect.Backwards Compatibility
This change is backwards compatible. Existing code will continue to work, but may benefit from adopting the new best practices.
Missing
User experience
Using decorator
Using manual method
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.