Skip to content

Feature request: rename raiseOnEmptyMetrics to throwOnEmptyMetrics #348

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

Closed
saragerion opened this issue Dec 27, 2021 · 1 comment · Fixed by #416
Closed

Feature request: rename raiseOnEmptyMetrics to throwOnEmptyMetrics #348

saragerion opened this issue Dec 27, 2021 · 1 comment · Fixed by #416
Labels
completed This item is complete and has been merged/shipped feature-request This item refers to a feature request for an existing or new utility good-first-issue Something that is suitable for those who want to start contributing metrics This item relates to the Metrics Utility

Comments

@saragerion
Copy link
Contributor

Description of the feature request

Currently the metrics Class has a class propriety shouldRaiseOnEmptyMetrics and middleware/decorator parameter raiseOnEmptyMetrics that when set to true, will cause the library to throw an error when no metrics are created.
As flagged by @dreamorosi in this PR, throw is a more intuitive and accurate way to describe the behaviour in the Node.js runtime.
The name is currently ported as it is from the Python library.

Problem statement

Based on above, the name of the parameters can be confusing for developers using the Node.js runtime.

Summary of the feature

  • Rename both the middleware/decorator parameters, the class propriety and the types (from raise to throw)
  • Update the documentations and examples

Code examples

const handlerWithMiddleware = middy(lambdaHandler)
  .use(logMetrics(metrics, { throwOnEmptyMetrics: true }));

Benefits for you and the wider AWS community

Better clarity of the feature, less confusion.

Describe alternatives you've considered

N/A

Additional context

Related issues, RFCs

@saragerion saragerion added this to the production-ready-release milestone Dec 27, 2021
@dreamorosi dreamorosi added good-first-issue Something that is suitable for those who want to start contributing metrics This item relates to the Metrics Utility labels Dec 27, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2022

⚠️ COMMENT VISIBILITY WARNING ⚠️

Comments on closed issues 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.

@dreamorosi dreamorosi changed the title metrics: rename raiseOnEmptyMetrics to throwOnEmptyMetrics Feature request: rename raiseOnEmptyMetrics to throwOnEmptyMetrics Nov 14, 2022
@dreamorosi dreamorosi added feature-request This item refers to a feature request for an existing or new utility completed This item is complete and has been merged/shipped labels Nov 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
completed This item is complete and has been merged/shipped feature-request This item refers to a feature request for an existing or new utility good-first-issue Something that is suitable for those who want to start contributing metrics This item relates to the Metrics Utility
Projects
None yet
2 participants