mirror of
https://github.com/prometheus/prometheus
synced 2024-12-25 07:52:28 +00:00
retrieval: handle nil target groups from updates
This commit is contained in:
parent
8fe8ccce63
commit
4e087165aa
@ -288,6 +288,9 @@ func (ts *targetSet) runProviders(ctx context.Context, providers map[string]Targ
|
||||
}
|
||||
// First set of all targets the provider knows.
|
||||
for _, tgroup := range initial {
|
||||
if tgroup == nil {
|
||||
continue
|
||||
}
|
||||
targets, err := targetsFromGroup(tgroup, ts.config)
|
||||
if err != nil {
|
||||
log.With("target_group", tgroup).Errorf("Target update failed: %s", err)
|
||||
@ -333,6 +336,9 @@ func (ts *targetSet) runProviders(ctx context.Context, providers map[string]Targ
|
||||
|
||||
// update handles a target group update from a target provider identified by the name.
|
||||
func (ts *targetSet) update(name string, tgroup *config.TargetGroup) error {
|
||||
if tgroup == nil {
|
||||
return nil
|
||||
}
|
||||
targets, err := targetsFromGroup(tgroup, ts.config)
|
||||
if err != nil {
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user