-
Notifications
You must be signed in to change notification settings - Fork 406
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(metrics): add flush_metrics() method to allow manual flushing of metrics #2171
Conversation
695761c
to
79433b2
Compare
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.
This example file was not being used in the documentation, so I just changed the content and started using it.
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## develop #2171 +/- ##
========================================
Coverage 97.46% 97.46%
========================================
Files 147 147
Lines 6872 6875 +3
Branches 505 505
========================================
+ Hits 6698 6701 +3
Misses 137 137
Partials 37 37
☔ 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.
Another excellent job Ruben!!
I'm wondering if we should do the same as the typescript and move the "Flushing metrics manually" topic to the "Flushing Metrics" menu. What do you think about?
Reference:
https://awslabs.github.io/aws-lambda-powertools-typescript/latest/core/metrics/#manually
Peer-review feedback:
|
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.
dummy logic to try/finally makes more sense
Co-authored-by: Heitor Lessa <lessa@amazon.co.uk> Signed-off-by: Ruben Fonseca <fonseka@gmail.com>
Co-authored-by: Heitor Lessa <lessa@amazon.co.uk> Signed-off-by: Ruben Fonseca <fonseka@gmail.com>
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.
Issue number: #2109
Summary
Changes
This PR adds a new
flush_metrics
to the metrics utility to manually flush the metrics.User experience
Before this PR it was hard for users of the metrics utility to flush the metrics when not running on the Lambda runtime. This simple refactor enables the users
quick access to manually flushing the metrics.
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.