mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-12 14:27:27 -08:00
nomad: Use failuresCount counter
Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
This commit is contained in:
parent
d9347bf128
commit
466f053a6e
|
@ -167,6 +167,7 @@ func (d *Discovery) refresh(ctx context.Context) ([]*targetgroup.Group, error) {
|
||||||
}
|
}
|
||||||
stubs, _, err := d.client.Services().List(opts)
|
stubs, _, err := d.client.Services().List(opts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
failuresCount.Inc()
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,6 +179,7 @@ func (d *Discovery) refresh(ctx context.Context) ([]*targetgroup.Group, error) {
|
||||||
for _, service := range stub.Services {
|
for _, service := range stub.Services {
|
||||||
instances, _, err := d.client.Services().Get(service.ServiceName, opts)
|
instances, _, err := d.client.Services().Get(service.ServiceName, opts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
failuresCount.Inc()
|
||||||
return nil, fmt.Errorf("failed to fetch services: %w", err)
|
return nil, fmt.Errorf("failed to fetch services: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue