Skip to content
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

improv(metrics): avoid emitting empty EMF metric #3044

Merged
merged 2 commits into from
Sep 12, 2024

Conversation

dreamorosi
Copy link
Contributor

@dreamorosi dreamorosi commented Sep 10, 2024

Summary

Changes

Please provide a summary of what's being changed

This PR improves the Metrics utility by avoiding to log an empty metric when the buffer is flushed and no metric is present.

Before this PR the utility would log an EMF log with no metrics when attempting to flush the buffer and no metrics were set. The PR aligns the behavior with the Python version of Powertools for AWS.

Please add the issue number below, if no issue is present the PR might get blocked and not be reviewed

Issue number: closes #3023


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.

@dreamorosi dreamorosi self-assigned this Sep 10, 2024
@boring-cyborg boring-cyborg bot added metrics This item relates to the Metrics Utility tests PRs that add or change tests labels Sep 10, 2024
@pull-request-size pull-request-size bot added the size/L PRs between 100-499 LOC label Sep 10, 2024
@github-actions github-actions bot added the enhancement PRs that introduce minor changes, usually to existing features label Sep 10, 2024
@dreamorosi dreamorosi force-pushed the improv/metrics_no_empty branch from d9ef057 to 00be222 Compare September 11, 2024 13:11
@dreamorosi dreamorosi marked this pull request as ready for review September 11, 2024 17:53
@dreamorosi dreamorosi requested review from a team as code owners September 11, 2024 17:53
Copy link

Copy link
Contributor

@leandrodamascena leandrodamascena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

APPROVED!

@dreamorosi dreamorosi merged commit 3bb9c93 into main Sep 12, 2024
11 checks passed
@dreamorosi dreamorosi deleted the improv/metrics_no_empty branch September 12, 2024 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement PRs that introduce minor changes, usually to existing features metrics This item relates to the Metrics Utility size/L PRs between 100-499 LOC tests PRs that add or change tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: Avoid flushing metrics when no metrics to flush
2 participants