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

cortex-mixin: Make cluster_namespace_deployment:kube_pod_container_resource_requests_{cpu_cores,memory_bytes}:sum backwards compatible with kube-state-metrics v2.0.0 #317

Conversation

jvrplmlmn
Copy link
Contributor

@jvrplmlmn jvrplmlmn commented May 31, 2021

What this PR does:

This updates the recording rules to make them compatible with kube-state-metrics v2.0.0
which introduces some breaking changes in some metric names.

With kube-state-metrics v2.0.0:

  • kube_pod_container_resource_requests_cpu_cores becomes kube_pod_container_resource_requests{resource="cpu"}
  • kube_pod_container_resource_requests_memory_bytes becomes kube_pod_container_resource_requests{resource="memory"}

Edit: I have taken a look at kube-state-metrics CHANGELOG and since v1.4.0 the new metrics that I'm referencing here are available. Internally I have double checked that the new expression is compatible, as it returns the same data as the old one.

Which issue(s) this PR fixes:
N/A

Checklist

  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

This updates the recording rules to make them compatible with kube-state-metrics v2.0.0
which introduces some breaking changes in some metric names.

With kube-state-metrics v2.0.0:
- `kube_pod_container_resource_requests_cpu_cores` becomes `kube_pod_container_resource_requests{resource="cpu"}`
- `kube_pod_container_resource_requests_memory_bytes` becomes `kube_pod_container_resource_requests{resource="memory"}`
@jvrplmlmn jvrplmlmn self-assigned this May 31, 2021
@jvrplmlmn jvrplmlmn marked this pull request as ready for review May 31, 2021 12:51
@jvrplmlmn jvrplmlmn requested a review from a team as a code owner May 31, 2021 12:51
Copy link
Collaborator

@pracucci pracucci left a comment

Choose a reason for hiding this comment

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

I would add backward compatibility using or so we don't introduce a breaking change.

@jvrplmlmn jvrplmlmn changed the title cortex-mixin: Use kube_pod_container_resource_{requests,limits} metrics cortex-mixin: Make cluster_namespace_deployment:kube_pod_container_resource_requests_{cpu_cores,memory_bytes}:sum backwards compatible with kube-state-metrics v2.0.0 May 31, 2021
Copy link
Collaborator

@pracucci pracucci left a comment

Choose a reason for hiding this comment

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

LGTM!

@pracucci pracucci merged commit 9b2090f into main Jun 1, 2021
@pracucci pracucci deleted the jvrplmlmn/recording-rules/update_kube_pod_container_resource_requests branch June 1, 2021 08:31
simonswine pushed a commit to grafana/mimir that referenced this pull request Oct 18, 2021
…recording-rules/update_kube_pod_container_resource_requests

cortex-mixin: Make `cluster_namespace_deployment:kube_pod_container_resource_requests_{cpu_cores,memory_bytes}:sum` backwards compatible with `kube-state-metrics` v2.0.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants