mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-25 05:34:05 -08:00
Fixes according to the code review
Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>
This commit is contained in:
parent
39d008f94f
commit
9d8463339d
|
@ -3415,6 +3415,10 @@ static_configs:
|
|||
# List of Alertmanager relabel configurations.
|
||||
relabel_configs:
|
||||
[ - <relabel_config> ... ]
|
||||
|
||||
# List of alert relabel configurations.
|
||||
alert_relabel_configs:
|
||||
[ - <relabel_config> ... ]
|
||||
```
|
||||
|
||||
### `<remote_write>`
|
||||
|
|
|
@ -383,13 +383,11 @@ func relabelAlerts(relabelConfigs []*relabel.Config, externalLabels labels.Label
|
|||
|
||||
for _, a := range alerts {
|
||||
lb.Reset(a.Labels)
|
||||
if externalLabels.Len() > 0 {
|
||||
externalLabels.Range(func(l labels.Label) {
|
||||
if a.Labels.Get(l.Name) == "" {
|
||||
lb.Set(l.Name, l.Value)
|
||||
}
|
||||
})
|
||||
}
|
||||
externalLabels.Range(func(l labels.Label) {
|
||||
if a.Labels.Get(l.Name) == "" {
|
||||
lb.Set(l.Name, l.Value)
|
||||
}
|
||||
})
|
||||
|
||||
keep := relabel.ProcessBuilder(lb, relabelConfigs...)
|
||||
if !keep {
|
||||
|
|
Loading…
Reference in a new issue