Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change query function to rate for etcd_network_client_grpc_sent_bytes_total metric #1185

Merged
merged 1 commit into from
Apr 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def api_call_latency(title, verb, scope, threshold):
d.simple_graph("etcd leader", "etcd_server_is_leader", legend="{{instance}}"),
d.simple_graph(
"etcd bytes sent",
"irate(etcd_network_client_grpc_sent_bytes_total[1m])",
"rate(etcd_network_client_grpc_sent_bytes_total[1m])",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you provide an explanation why rate is prefered over irate in this case? I suspect the reason is not obvious. Let's save next person time on figuring it out :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Experience shows that irate doesn't work good with this metric. When I conducted A/B testing between two different 5k runs here, graphs of the aforementioned metric looked completely different with irate applied. With rate function the graphs looked pretty much the same.

From Prometheus' doc:
irate should only be used when graphing volatile, fast-moving counters. Use rate for alerts and slow-moving counters, as brief changes in the rate can reset the FOR clause and graphs consisting entirely of rare spikes are hard to read.

yAxes=g.single_y_axis(format=g.BYTES_PER_SEC_FORMAT),
legend="{{instance}}",
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1192,7 +1192,7 @@
"targets": [
{
"datasource": "",
"expr": "irate(etcd_network_client_grpc_sent_bytes_total[1m])",
"expr": "rate(etcd_network_client_grpc_sent_bytes_total[1m])",
"format": "time_series",
"instant": false,
"interval": "5s",
Expand Down