fix: Add get_entry_by_id command so we can fetch a metric for testing#38
Merged
litianningdatadog merged 1 commit intomainfrom Aug 28, 2025
Merged
fix: Add get_entry_by_id command so we can fetch a metric for testing#38litianningdatadog merged 1 commit intomainfrom
litianningdatadog merged 1 commit intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a get_entry_by_id command to the aggregator service to enable fetching metrics by their identifier for testing purposes. This allows test code to verify that metrics have been properly stored in the aggregator.
- Adds a new
GetEntryByIdcommand variant to theAggregatorCommandenum - Implements the
get_entry_by_idmethod onAggregatorHandlefor external access - Adds command handling logic in the service loop to process get requests
- Includes comprehensive tests to verify the new functionality works correctly
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Comment on lines
+141
to
+142
| if let Err(_) = response_tx.send(response) { | ||
| error!("Failed to send get_entry_by_id response - receiver dropped"); |
There was a problem hiding this comment.
[nitpick] The error value is being ignored with _. Consider logging the error or using a more descriptive variable name like _send_error to clarify the intentional discard.
Suggested change
| if let Err(_) = response_tx.send(response) { | |
| error!("Failed to send get_entry_by_id response - receiver dropped"); | |
| if let Err(send_error) = response_tx.send(response) { | |
| error!("Failed to send get_entry_by_id response - receiver dropped: {:?}", send_error); |
duncanista
approved these changes
Aug 27, 2025
litianningdatadog
pushed a commit
to DataDog/datadog-lambda-extension
that referenced
this pull request
Aug 29, 2025
1. Upgrades dogstatsd-rs so that we use the channel based, lock-free aggregator 2. sets the context size to 500 contexts instead of 5, which is helpful for very very fast functions TODO update git sha when we merge DataDog/serverless-components#38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
This should probably be a test macro but I kinda like a no-macro rule generally so I'm just adding this method back so we can assert on things we put in the aggregator.
Motivation
Additional Notes
Describe how to test/QA your changes