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

(cherry picked from commit 7e5a206057)
This commit is contained in:
Andrii Chubatiuk 2024-05-29 14:56:05 +03:00 committed by hagen1778
parent 9d301809b6
commit 2c4a42554a
No known key found for this signature in database
GPG key ID: 3BF75F3741CA9640

View file

@ -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) {