Skip to content

test(dogstatsd): add critical unit tests for aggregation, retry logic, and metric filtering#80

Merged
duncanista merged 1 commit intomainfrom
jordan.gonzalez/dogstatsd/add-critical-unit-tests
Feb 23, 2026
Merged

test(dogstatsd): add critical unit tests for aggregation, retry logic, and metric filtering#80
duncanista merged 1 commit intomainfrom
jordan.gonzalez/dogstatsd/add-critical-unit-tests

Conversation

@duncanista
Copy link
Contributor

@duncanista duncanista commented Feb 19, 2026

What does this PR do?

Add tests covering three previously untested critical paths:

  • Aggregation semantics: verify count metrics sum, gauge metrics take the last value, distribution sketches merge correctly, and mixed metric types stay in separate contexts.
  • should_try_next_batch() retry logic: cover all branching paths including 202 success, 4xx permanent errors, 5xx temporary errors, payload errors, destination errors with/without status codes.
  • aws.lambda.enhanced.invocations filter: verify the hardcoded deduplication filter correctly drops this metric while passing through other metrics.

Motivation

Ensure we have complete tests

Describe how to test/QA your changes

Unit tests

…, and metric filtering

Add tests covering three previously untested critical paths:

- Aggregation semantics: verify count metrics sum, gauge metrics take
  the last value, distribution sketches merge correctly, and mixed
  metric types stay in separate contexts.
- should_try_next_batch() retry logic: cover all branching paths
  including 202 success, 4xx permanent errors, 5xx temporary errors,
  payload errors, destination errors with/without status codes.
- aws.lambda.enhanced.invocations filter: verify the hardcoded
  deduplication filter correctly drops this metric while passing
  through other metrics.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@duncanista duncanista changed the title test(dogstatsd): add critical unit tests for aggregation, retry logic… test(dogstatsd): add critical unit tests for aggregation, retry logic, and metric filtering Feb 19, 2026
@duncanista duncanista marked this pull request as ready for review February 19, 2026 05:03
@duncanista duncanista requested review from a team as code owners February 19, 2026 05:03
@duncanista duncanista requested review from apiarian-datadog and lym953 and removed request for a team February 19, 2026 05:03
Copy link
Contributor

@lym953 lym953 left a comment

Choose a reason for hiding this comment

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

Thanks for adding the tests!

@duncanista duncanista merged commit 8466769 into main Feb 23, 2026
26 checks passed
@duncanista duncanista deleted the jordan.gonzalez/dogstatsd/add-critical-unit-tests branch February 23, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants