mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Merge pull request #3405 from dominikschulz/fix/issue-3001
Guard against tags being nil in EC2 discovery
This commit is contained in:
commit
bf8e002fce
|
@ -200,6 +200,9 @@ func (d *Discovery) refresh() (tg *config.TargetGroup, err error) {
|
|||
}
|
||||
|
||||
for _, t := range inst.Tags {
|
||||
if t == nil || t.Key == nil || t.Value == nil {
|
||||
continue
|
||||
}
|
||||
name := strutil.SanitizeLabelName(*t.Key)
|
||||
labels[ec2LabelTag+model.LabelName(name)] = model.LabelValue(*t.Value)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue