enhancement(reduce transform): New setting for reduce transform: end_every_period_ms #20440
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.
I propose a new setting available for use on reduce transforms:
end_every_period_ms
.In my organization's use of vector, we are tailing Java log files to look for garbage collection events. We want to know the duration of the longest garbage collection that happened lately, for a rolling "lately," and report that value to Prometheus. I don't believe we can accomplish this with vector at present, but this PR will enable it. We can collect values and reduce them with a
max
merge strategy, then flush them every 60 seconds.I am sure that this will be useful to many users in the long run. Periodically flushing a reducer surely has many applications.
I have compiled vector with this change and deployed it within my organization, and confirmed that it works for us. For example, here is a snippet of our config:
This PR does not include new test coverage. I am new to Rust and not familiar with best testing practices. My new code has behavior dependent on the system clock, and that seems hard to test.