You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: new container cpu usage recording rule using rate() (#1025)
* chore: revert irate function back to rate
* chore: keep irate for node_namespace_pod_ontainer and add rate in as well
* chore: add test for apps
* Update tests/tests.yaml
Co-authored-by: Stephen Lang <[email protected]>
* chore: add 5m to queries to match recording name
* chore: update readme
* update readme
* chore: fix readme formatting
* Update README.md
Co-authored-by: Stephen Lang <[email protected]>
* Update dashboards/resources/node.libsonnet
Co-authored-by: Stephen Lang <[email protected]>
* try adding space
---------
Co-authored-by: Stephen Lang <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,6 +56,20 @@ Maintainers can trigger the [release workflow](.github/workflows/release.yaml) b
56
56
57
57
We wanted to backfill `release-0.1` to `release-0.12` to have a changelog, but we were not able to use a GitHub action in a newer commit to trigger a release that generates a changelog on older commits. See #489 for full discussion.
58
58
59
+
## Metrics Deprecation
60
+
61
+
The following recording rule is marked deprecated. It will be removed in v2.0.0.
It will be replaced by the following recording rule to preserve data points using `rate` and add `5m` to indicate the range of the rate query in the recording rule name.
This mixin is designed to be vendored into the repo with your infrastructure config. To do this, use [jsonnet-bundler](https://github.com/jsonnet-bundler/jsonnet-bundler):
Copy file name to clipboardExpand all lines: dashboards/resources/cluster.libsonnet
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -129,7 +129,7 @@ local var = g.dashboard.variable;
129
129
+ tsPanel.queryOptions.withTargets([
130
130
prometheus.new(
131
131
'${datasource}',
132
-
'sum(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_irate{%(clusterLabel)s="$cluster"}) by (namespace)' % $._config
132
+
'sum(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_rate5m{%(clusterLabel)s="$cluster"}) by (namespace)' % $._config
133
133
)
134
134
+ prometheus.withLegendFormat('__auto'),
135
135
]),
@@ -144,23 +144,23 @@ local var = g.dashboard.variable;
144
144
+ prometheus.withInstant(true)
145
145
+ prometheus.withFormat('table'),
146
146
147
-
prometheus.new('${datasource}', 'sum(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_irate{%(clusterLabel)s="$cluster"}) by (namespace)' % $._config)
147
+
prometheus.new('${datasource}', 'sum(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_rate5m{%(clusterLabel)s="$cluster"}) by (namespace)' % $._config)
148
148
+ prometheus.withInstant(true)
149
149
+ prometheus.withFormat('table'),
150
150
151
151
prometheus.new('${datasource}', 'sum(namespace_cpu:kube_pod_container_resource_requests:sum{%(clusterLabel)s="$cluster"}) by (namespace)' % $._config)
152
152
+ prometheus.withInstant(true)
153
153
+ prometheus.withFormat('table'),
154
154
155
-
prometheus.new('${datasource}', 'sum(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_irate{%(clusterLabel)s="$cluster"}) by (namespace) / sum(namespace_cpu:kube_pod_container_resource_requests:sum{%(clusterLabel)s="$cluster"}) by (namespace)' % $._config)
155
+
prometheus.new('${datasource}', 'sum(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_rate5m{%(clusterLabel)s="$cluster"}) by (namespace) / sum(namespace_cpu:kube_pod_container_resource_requests:sum{%(clusterLabel)s="$cluster"}) by (namespace)' % $._config)
156
156
+ prometheus.withInstant(true)
157
157
+ prometheus.withFormat('table'),
158
158
159
159
prometheus.new('${datasource}', 'sum(namespace_cpu:kube_pod_container_resource_limits:sum{%(clusterLabel)s="$cluster"}) by (namespace)' % $._config)
160
160
+ prometheus.withInstant(true)
161
161
+ prometheus.withFormat('table'),
162
162
163
-
prometheus.new('${datasource}', 'sum(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_irate{%(clusterLabel)s="$cluster"}) by (namespace) / sum(namespace_cpu:kube_pod_container_resource_limits:sum{%(clusterLabel)s="$cluster"}) by (namespace)' % $._config)
163
+
prometheus.new('${datasource}', 'sum(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_rate5m{%(clusterLabel)s="$cluster"}) by (namespace) / sum(namespace_cpu:kube_pod_container_resource_limits:sum{%(clusterLabel)s="$cluster"}) by (namespace)' % $._config)
0 commit comments