-
Notifications
You must be signed in to change notification settings - Fork 154
Bug: manually calling refreshSampleRateCalculation does not refresh the sampling decision #3718
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
Comments
Thanks for opening your first issue here! We'll come back to you as soon as we can. |
Hi @grimmbraten - thank you for opening the issue and reporting this bug. From a couple of initial tests I can confirm that we have a bug when using the code you shared above. This is related to some changes we introduced in 2.16.0 and this is a regression. I am still investigating a fix, but it might require some work to accommodate the original (2.15.0) and new (2.16.0) behavior. I'll share more info here as soon as I have them, in the meantime I'd recommend rolling back to v2.15.0. |
I identified the issue and opened a PR that should fix it. |
This issue is now closed. Please be mindful that future comments are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so. |
Hey @dreamorosi 👋 Thank you for fixing the bug! When will a release be available with the fix included? ☺ |
We've made a release that includes the fix less than half hour ago. The new version (2.17.0) is already on npm but we haven't published the release notes yet. |
This is now released under v2.17.0 version! |
Expected Behavior
Invoking a hot Lambda function refreshes the sampling decision. This results in that log level being sometimes lowered to
DEBUG
based on my setsampleRateValue
.Current Behavior
Invoking a hot Lambda function does not refresh the sampling decision. The sampling decision seems to only happen on Logger initialization.
Code snippet
The Lambda function uses the
POWERTOOLS_LOGGER_SAMPLE_RATE
environment variable with a value of0.5
.Steps to Reproduce
POWERTOOLS_LOGGER_SAMPLE_RATE
environment variable and that it has a high percentage to lower the log level.2.15.0
of the@aws-lambda-powertools/logger
, deploy the function, and invoke it a few times to confirm that theDEBUG
log level is sometimes used.2.16.0
of the@aws-lambda-powertools/logger
, deploy the function, and invoke it a few times. TheDEBUG
log level will be used for all invocations or none of them (refreshSampleRateCalculation
function has no effect).Possible Solution
No response
Powertools for AWS Lambda (TypeScript) version
latest
AWS Lambda function runtime
20.x
Packaging format used
npm
Execution logs
The text was updated successfully, but these errors were encountered: