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
This commit is contained in:
Andrii Chubatiuk 2024-05-29 14:56:05 +03:00 committed by GitHub
parent 14ba7b237d
commit 7e5a206057
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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