app/vmagent/remotewrite: allow passing empty -remoteWrite.urlRelabelConfig entries

This commit is contained in:
Aliaksandr Valialkin 2020-07-20 15:49:05 +03:00
parent 141e84b5a4
commit 86b54f3768

View file

@ -43,6 +43,10 @@ func loadRelabelConfigs() (*relabelConfigs, error) {
}
rcs.perURL = make([][]promrelabel.ParsedRelabelConfig, len(*remoteWriteURLs))
for i, path := range *relabelConfigPaths {
if len(path) == 0 {
// Skip empty relabel config.
continue
}
prc, err := promrelabel.LoadRelabelConfigs(path)
if err != nil {
return nil, fmt.Errorf("cannot load relabel configs from -remoteWrite.urlRelabelConfig=%q: %w", path, err)