-
Notifications
You must be signed in to change notification settings - Fork 154
feat(logger): refresh sample rate calculation before each invocation #3672
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): refresh sample rate calculation before each invocation #3672
Conversation
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.
Left one comment about a docstring, other than that I have built and tested the package and it works, same for e2e tests which are green.
…ge based on invocation percentage
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 the PR!
|
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.
Good to go
…in logger context## Summary
Changes
This PR modifies the
sampleRate
behaviour for the logger and will now sample per invocation, instead of execution environment. When usinginjectLambdaContext
either as decorator or as middleware, we now automatically refresh sample rate.As discussed in #3278 we avoid duplicate sample decision during cold starts, as it might happen in the Logger constructor. To make this possible, I have exposed
coldStart
field from theUtility
class.Issue number: closes #3278
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.