Skip to content

Commit

Permalink
increase time period for rate over cadvisor metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
paulfantom committed Oct 2, 2019
1 parent f458e85 commit c72ae7b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet';
config: |||
resourceRules:
cpu:
containerQuery: sum(rate(container_cpu_usage_seconds_total{<<.LabelMatchers>>,container!="POD",container!="",pod!=""}[1m])) by (<<.GroupBy>>)
containerQuery: sum(rate(container_cpu_usage_seconds_total{<<.LabelMatchers>>,container!="POD",container!="",pod!=""}[5m])) by (<<.GroupBy>>)
nodeQuery: sum(1 - rate(node_cpu_seconds_total{mode="idle"}[1m]) * on(namespace, pod) group_left(node) node_namespace_pod:kube_pod_info:{<<.LabelMatchers>>}) by (<<.GroupBy>>)
resources:
overrides:
Expand Down

2 comments on commit c72ae7b

@gitfool
Copy link
Contributor

@gitfool gitfool commented on c72ae7b Oct 6, 2019

Choose a reason for hiding this comment

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

@paulfantom Excuse the stupid question; I've been learning how to configure this adapter with the prometheus operator and wondering if the window should be increased to 5m too, or is it okay for this query to be a multiple of the window and leave the window at 1m? (I'm getting gaps in the resource metrics, so wondering what the optimal values are.)

@paulfantom
Copy link
Member Author

Choose a reason for hiding this comment

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

window should match the value used as duration in containerQuery and/or nodeQuery when using rate() function. This means that I accidentally introduced a bug with this commit and window should be extended to 5m. Sorry for that and thank you for finding it.

Please sign in to comment.