Skip to content

Commit

Permalink
Added support for global labels
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashwini Dhekane committed Mar 5, 2019
1 parent e58be7a commit b6ff8b9
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,17 @@ func load(s string) (*Config, error) {
}

cfg.original = s
cfg.prepareLabels()

return cfg, nil
}
}

func (this *Config) prepareLabels() {
for _, logGroups := range this.LogGroups {
for ln, lv := range this.Labels {
if _, exists := logGroups.GlobalLabels[ln]; ! exists {
logGroups.GlobalLabels[ln] = lv
}
}
}
}

0 comments on commit b6ff8b9

Please sign in to comment.