Skip to content

Commit

Permalink
Documentation/op-guide: fix failed RPC rate, leader election metrics
Browse files Browse the repository at this point in the history
This fixes failed RPC rate query, where we do not need
subtraction because we already query by the status code.
Also adds grpc_method to make it more specific. Most of the
time, the failure recovers within 10-second, which is our
Prometheus scrap interval, so 'rate' query might not cover
that time window, showing as 0s, but still shows up in the graph.

Signed-off-by: Gyu-Ho Lee <[email protected]>
  • Loading branch information
gyuho committed Jun 14, 2017
1 parent 750dc7f commit 943a113
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Documentation/op-guide/grafana.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,17 @@
"stack": false,
"steppedLine": false,
"targets": [{
"expr": "sum(rate(grpc_server_started_total{grpc_type=\"unary\"} [1m]))",
"expr": "sum(rate(grpc_server_started_total{grpc_type=\"unary\"}[1m])) by (grpc_method)",
"intervalFactor": 2,
"legendFormat": "{{instance}} RPC Rate",
"legendFormat": "{{grpc_method}} RPC Rate",
"metric": "grpc_server_started_total",
"refId": "A",
"step": 2
},
{
"expr": "sum(rate(grpc_server_started_total{grpc_type=\"unary\"} [1m])) - sum(rate(grpc_server_handled_total{grpc_type=\"unary\",grpc_code!=\"OK\"} [1m]))",
"expr": "rate(grpc_server_handled_total{grpc_type=\"unary\",grpc_code!=\"OK\"}[1m])",
"intervalFactor": 2,
"legendFormat": "{{instance}} RPC Failed Rate",
"legendFormat": "{{instance}} {{grpc_method}} RPC Failed Rate",
"metric": "grpc_server_handled_total",
"refId": "B",
"step": 2
Expand Down Expand Up @@ -924,15 +924,15 @@
"targets": [{
"expr": "etcd_server_leader_changes_seen_total",
"intervalFactor": 2,
"legendFormat": "{{instance}} Leader Change Seen",
"legendFormat": "{{instance}} Total Leader Changes",
"metric": "etcd_server_leader_changes_seen_total",
"refId": "A",
"step": 2
}],
"thresholds": [],
"timeFrom": null,
"timeShift": null,
"title": "Rate Leader Elections",
"title": "Total Leader Elections",
"tooltip": {
"msResolution": false,
"shared": true,
Expand Down Expand Up @@ -1009,4 +1009,4 @@
"version": 215,
"links": [],
"gnetId": null
}
}

0 comments on commit 943a113

Please sign in to comment.