Skip to content

Feature request: log a warning when no metric is emitted #1291

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
1 of 2 tasks
dreamorosi opened this issue Feb 15, 2023 · 1 comment · Fixed by #1397
Closed
1 of 2 tasks

Feature request: log a warning when no metric is emitted #1291

dreamorosi opened this issue Feb 15, 2023 · 1 comment · Fixed by #1397
Assignees
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 metrics This item relates to the Metrics Utility

Comments

@dreamorosi
Copy link
Contributor

dreamorosi commented Feb 15, 2023

Use case

As a customer, I want to see a warning log in my Lambda functions that are using the logMetrics decorator or middleware, if no metric is emitted.

This warning log will help users of the Metrics utility to detect instances in which the utility is present in the code, but not being really used. With this information they can then decide whether they want to remove the utility or fix issues related to metrics not being emitted correctly.

This feature is present in the Powertools for Python version, and was discussed here: aws-powertools/powertools-lambda-python#1926

Solution/User Experience

If no metric is emitted the utility should emit a log that says:

No application metrics to publish. The cold-start metric may be published if enabled. If application metrics should never be empty, consider using "throwOnEmptyMetrics"

Alternative solutions

No response

Acknowledgment

@dreamorosi dreamorosi added metrics This item relates to the Metrics Utility feature-request This item refers to a feature request for an existing or new utility confirmed The scope is clear, ready for implementation labels Feb 15, 2023
@dreamorosi dreamorosi self-assigned this Apr 3, 2023
@dreamorosi dreamorosi moved this from Backlog to Working on it in AWS Lambda Powertools for TypeScript Apr 5, 2023
@dreamorosi dreamorosi linked a pull request Apr 5, 2023 that will close this issue
13 tasks
@github-project-automation github-project-automation bot moved this from Working on it to Coming soon in AWS Lambda Powertools for TypeScript Apr 6, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Apr 6, 2023

⚠️ 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.

@github-actions github-actions bot added the pending-release This item has been merged and will be released soon label Apr 6, 2023
@dreamorosi dreamorosi removed the pending-release This item has been merged and will be released soon label Apr 11, 2023
@dreamorosi dreamorosi moved this from Coming soon to Shipped in AWS Lambda Powertools for TypeScript Apr 11, 2023
@dreamorosi dreamorosi added completed This item is complete and has been merged/shipped and removed confirmed The scope is clear, ready for implementation labels Apr 11, 2023
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 metrics This item relates to the Metrics Utility
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant