diff --git a/app/vmagent/remotewrite/remotewrite.go b/app/vmagent/remotewrite/remotewrite.go index 88eb0daa96..31f32267e8 100644 --- a/app/vmagent/remotewrite/remotewrite.go +++ b/app/vmagent/remotewrite/remotewrite.go @@ -743,12 +743,12 @@ func (rwctx *remoteWriteCtx) pushInternal(tss []prompbmarshal.TimeSeries) { func (rwctx *remoteWriteCtx) reinitStreamAggr() { sas := rwctx.sas.Load() - if sas == nil { + + sasFile := streamAggrConfig.GetOptionalArg(rwctx.idx) + if sasFile == "" { // There is no stream aggregation for rwctx return } - - sasFile := streamAggrConfig.GetOptionalArg(rwctx.idx) logger.Infof("reloading stream aggregation configs pointed by -remoteWrite.streamAggr.config=%q", sasFile) metrics.GetOrCreateCounter(fmt.Sprintf(`vmagent_streamaggr_config_reloads_total{path=%q}`, sasFile)).Inc() dedupInterval := streamAggrDedupInterval.GetOptionalArg(rwctx.idx)