From 7e5a206057a58be4b4d71cabe495922f9a2bbc2a Mon Sep 17 00:00:00 2001 From: Andrii Chubatiuk Date: Wed, 29 May 2024 14:56:05 +0300 Subject: [PATCH] app/vmagent: fixed streamaggr args (#6374) use GetOptionalArg instead of index to fallback to a first argument if index is absent for remotewrite.streamaggr.config --- app/vmagent/remotewrite/streamaggr.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/vmagent/remotewrite/streamaggr.go b/app/vmagent/remotewrite/streamaggr.go index 0c357d2980..454d14bf8b 100644 --- a/app/vmagent/remotewrite/streamaggr.go +++ b/app/vmagent/remotewrite/streamaggr.go @@ -143,7 +143,7 @@ func getStreamAggrOpts(idx int) (string, *streamaggr.Options) { if len(*streamAggrConfig) == 0 { return "", &opts } - return (*streamAggrConfig)[idx], &opts + return streamAggrConfig.GetOptionalArg(idx), &opts } func newStreamAggrConfigWithOpts(pushFunc streamaggr.PushFunc, path string, opts *streamaggr.Options) (*streamaggr.Aggregators, error) {