nomad: Use failuresCount counter
@@ -167,6 +167,7 @@ func (d *Discovery) refresh(ctx context.Context) ([]*targetgroup.Group, error) {
}
stubs, _, err := d.client.Services().List(opts)
if err != nil {
+ failuresCount.Inc()
return nil, err
}
@@ -178,6 +179,7 @@ func (d *Discovery) refresh(ctx context.Context) ([]*targetgroup.Group, error) {
for _, service := range stub.Services {
instances, _, err := d.client.Services().Get(service.ServiceName, opts)
if err != nil {
+ failuresCount.Inc()
return nil, fmt.Errorf("failed to fetch services: %w", err)
}
