mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
app/{vmalert,vmagent}: skip empty values in -remoteWrite.label
and -label
lists
This commit is contained in:
parent
5454668709
commit
b6b1b06d70
2 changed files with 6 additions and 0 deletions
|
@ -65,6 +65,9 @@ type relabelConfigs struct {
|
|||
func initLabelsGlobal() {
|
||||
labelsGlobal = nil
|
||||
for _, s := range *unparsedLabelsGlobal {
|
||||
if len(s) == 0 {
|
||||
continue
|
||||
}
|
||||
n := strings.IndexByte(s, '=')
|
||||
if n < 0 {
|
||||
logger.Fatalf("missing '=' in `-remoteWrite.label`. It must contain label in the form `name=value`; got %q", s)
|
||||
|
|
|
@ -160,6 +160,9 @@ func newManager(ctx context.Context) (*manager, error) {
|
|||
manager.rr = rr
|
||||
|
||||
for _, s := range *externalLabels {
|
||||
if len(s) == 0 {
|
||||
continue
|
||||
}
|
||||
n := strings.IndexByte(s, '=')
|
||||
if n < 0 {
|
||||
return nil, fmt.Errorf("missing '=' in `-label`. It must contain label in the form `name=value`; got %q", s)
|
||||
|
|
Loading…
Reference in a new issue