Merge pull request #4220 from guidoiaquinti/master

Client: add metric for failed RPC calls to a consul server
This commit is contained in:
Matt Keeler 2018-06-13 10:36:09 -04:00 committed by GitHub
commit ce67e6ed34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View File

@ -276,6 +276,7 @@ TRY:
// Move off to another server, and see if we can retry.
c.logger.Printf("[ERR] consul: %q RPC failed to server %s: %v", method, server.Addr, rpcErr)
metrics.IncrCounterWithLabels([]string{"client", "rpc", "failed"}, 1, []metrics.Label{{Name: "server", Value: server.Name}})
c.routers.NotifyFailedServer(server)
if retry := canRetry(args, rpcErr); !retry {
return rpcErr

View File

@ -75,6 +75,12 @@ These metrics are used to monitor the health of specific Consul agents.
<td>rejected requests</td>
<td>counter</td>
</tr>
<tr>
<td>`consul.client.rpc.failed`</td>
<td>This increments whenever a Consul agent in client mode makes an RPC request to a Consul server and fails.</td>
<td>requests</td>
<td>counter</td>
</tr>
<tr>
<td>`consul.client.api.catalog_register.<node>`</td>
<td>This increments whenever a Consul agent receives a catalog register request.</td>