diff --git a/app/vmagent/remotewrite/streamaggr.go b/app/vmagent/remotewrite/streamaggr.go index 0c357d298..454d14bf8 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) {