From 22d63ac7cd635657bfd37a507c94447f6bab8d91 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Mon, 4 Mar 2024 20:01:12 +0200 Subject: [PATCH] lib/streamaggr: do not reset aggregation state after the aggregation took longer than the configured interval It is better from user PoV preserving this state until the next flush --- lib/streamaggr/streamaggr.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/streamaggr/streamaggr.go b/lib/streamaggr/streamaggr.go index df08bc065..f8f5c8c6b 100644 --- a/lib/streamaggr/streamaggr.go +++ b/lib/streamaggr/streamaggr.go @@ -93,7 +93,7 @@ type Options struct { // The alignment of flushes can be disabled individually per each aggregation via no_align_flush_to_interval option. NoAlignFlushToInterval bool - // FlushOnShutdown enables flush of incomplete aggregation state. + // FlushOnShutdown enables flush of incomplete aggregation state on startup and shutdown. // // By default incomplete state is dropped. // @@ -126,7 +126,7 @@ type Config struct { // See also FlushOnShutdown. NoAlignFlushToInterval *bool `yaml:"no_align_flush_to_interval,omitempty"` - // FlushOnShutdown defines whether to flush incomplete aggregation state. + // FlushOnShutdown defines whether to flush incomplete aggregation state on startup and shutdown. // By default incomplete aggregation state is dropped, since it may confuse users. FlushOnShutdown *bool `yaml:"flush_on_shutdown,omitempty"` @@ -615,10 +615,6 @@ func (a *aggregator) runFlusher(pushFunc PushFunc, alignFlushToInterval, skipInc if alignFlushToInterval { select { case <-t.C: - if skipIncompleteFlush && tickerWait(t) { - logger.Warnf("drop incomplete aggregation state because the previous flush took longer than interval=%s", interval) - a.flush(nil, interval, true) - } default: } }