enable the ability for buffering and aggregation to work at the same#851
Merged
andrewqian2001datadog merged 14 commits intomasterfrom Aug 23, 2024
Merged
Conversation
…cs() and flush_aggregated_metrics since the flushed aggregated metrics are added to the buffer now
gh123man
previously approved these changes
Aug 22, 2024
Member
gh123man
left a comment
There was a problem hiding this comment.
Code changes look good to me. Just a minor suggestion to align the config naming.
Lets be sure we manually test/verify:
- aggregation + buffering
- buffering only
- aggregation only
(just for completeness).
Contributor
|
Would there be any potential problems with having the default aggregation flush interval that low? old |
Contributor
Author
|
Not sure but per vikentiy "I don't have an opinion whether they should share a thread, whatever is simpler I guess. We probably should not change the default flush interval though." @rayz |
gh123man
approved these changes
Aug 22, 2024
carlosroman
reviewed
Aug 23, 2024
HantingZhang2
approved these changes
Aug 23, 2024
|
@gh123man @carlosroman would it be possible to cut a |
Contributor
|
@gorangasic have created the release PR #856. Hopefully should all get approved really soon. |
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?
Issue
enable the ability for buffering and aggregation to work at the same
Description of the Change
Refactors code to enable aggregation/buffering at the same time. The aggregator will add the aggregated metrics into the buffer at the end of every flush interval before the buffer sends them to the agent. Aggregation/buffering share the same flush thread and flush interval.
Possible Drawbacks
aggregation and buffering seems tightly coupled, for example
Instead of killing the flush thread when buffering is disabled, (I assume) it needs to check if both aggregation and buffering is disabled before killing the flush thread. May be a good idea to add a if statement in stop_flush_thread to not kill the flush thread if either aggregation or buffering is enabled?
Verification Process
Added unit tests to test aggregation and buffering at the same time.
For Local testing:
Follow these steps for local testing and in the main.py file, enable aggregation and buffering at the same time
main.py
You can add a print statement here to ensure that the agggregated metrics are added to buffer, we would expect that the count metrics are aggregated (single metric with value of 10) inside the buffer
Additional Notes
Release Notes
Review checklist (to be filled by reviewers)
changelog/label attached. If applicable it should have thebackward-incompatiblelabel attached.do-not-merge/label attached.kind/andseverity/labels attached at least.