nomad: Use failuresCount counter

Signed-off-by: Julien Pivotto <roidelapluie@o11y.eu>
This commit is contained in:
Julien Pivotto 2022-06-30 14:19:33 +02:00
parent d9347bf128
commit 466f053a6e
1 changed files with 2 additions and 0 deletions

View File

@ -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)
}