mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
err fix if target creation fails
return right error if any target creation fails. Need to wrap the right error. Signed-off-by: Anshul <anshulkhandelwal.nitj@gmail.com>
This commit is contained in:
parent
80545bfb2e
commit
9c705ffdfb
|
@ -373,7 +373,7 @@ func (d *Discovery) refresh(ctx context.Context) ([]*targetgroup.Group, error) {
|
||||||
var tg targetgroup.Group
|
var tg targetgroup.Group
|
||||||
for tgt := range ch {
|
for tgt := range ch {
|
||||||
if tgt.err != nil {
|
if tgt.err != nil {
|
||||||
return nil, errors.Wrap(err, "unable to complete Azure service discovery")
|
return nil, errors.Wrap(tgt.err, "unable to complete Azure service discovery")
|
||||||
}
|
}
|
||||||
if tgt.labelSet != nil {
|
if tgt.labelSet != nil {
|
||||||
tg.Targets = append(tg.Targets, tgt.labelSet)
|
tg.Targets = append(tg.Targets, tgt.labelSet)
|
||||||
|
|
Loading…
Reference in a new issue