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

Add missing break statement #734

Merged

Conversation

masafm
Copy link
Contributor

@masafm masafm commented Feb 8, 2024

What does this PR do?

Break statement will be executed when flush() succeeds.

Motivation

Without break statement lambda function will submit the same metrics 5 times in a row.

Testing Guidelines

I tested this by deploying to my lambda function.

Before fix: metrics are submitted 5 times.

2024-02-08T10:06:49.242+09:00	START RequestId: a98d2fbb-d93b-4cd8-a627-c0a816d72ba0 Version: $LATEST
2024-02-08T10:06:50.491+09:00	INFO Submitted data with status: 202
2024-02-08T10:06:51.733+09:00	INFO Submitted data with status: 202
2024-02-08T10:06:52.980+09:00	INFO Submitted data with status: 202
2024-02-08T10:06:54.216+09:00	INFO Submitted data with status: 202
2024-02-08T10:06:55.454+09:00	INFO Submitted data with status: 202
2024-02-08T10:06:55.475+09:00	END RequestId: a98d2fbb-d93b-4cd8-a627-c0a816d72ba0

After fix: metrics are submitted only once.

2024-02-08T10:22:08.831+09:00	START RequestId: 1541446c-d918-48c7-869f-41232832c8eb Version: $LATEST
2024-02-08T10:22:10.329+09:00	INFO Submitted data with status: 202
2024-02-08T10:22:10.352+09:00	END RequestId: 1541446c-d918-48c7-869f-41232832c8eb

Additional Notes

Types of changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Check all that apply

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog
  • This PR passes the integration tests (ask a Datadog member to run the tests)
  • This PR passes the unit tests
  • This PR passes the installation tests (ask a Datadog member to run the tests)

@github-actions github-actions bot added the aws label Feb 8, 2024
@RaphaelAllier RaphaelAllier merged commit 5ac1468 into master Feb 8, 2024
13 checks passed
@RaphaelAllier RaphaelAllier deleted the masafumi.kashiwagi/fix-missing-break-statement branch February 8, 2024 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants