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

internal/store/pod.go: Only create last_terminated containers series if containers are terminated state #1397

Merged
merged 3 commits into from
Feb 24, 2021

Conversation

lilic
Copy link
Member

@lilic lilic commented Feb 24, 2021

See previous PRs for backgrounds. #1381 and #1378

kube_pod_init_container_status_last_terminated_reason and kube_pod_container_status_last_terminated_reason metrics are changed.

cc @brancz as you reviewed the others, this is the last one 🎉

… if pods are

terminated. This reduces the cardinality of this metric greatly, as it was
one of the highest cardinality metrics pre 2.0.
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Feb 24, 2021
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 24, 2021
@brancz
Copy link
Member

brancz commented Feb 24, 2021

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 24, 2021
this caused the go modules check to fail, as latest go version
introduced breaking changes it seems to modules.
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 24, 2021
@brancz
Copy link
Member

brancz commented Feb 24, 2021

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 24, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: brancz, lilic

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 0b70d7e into kubernetes:release-2.0 Feb 24, 2021
@lilic lilic deleted the remove-last-reason branch February 24, 2021 16:35
@jutley
Copy link
Contributor

jutley commented Mar 4, 2021

@lilic I added the kube_pod_container_status_last_terminated_reason metric in #535 because there was no good way to alert when a container was running out of memory. Since the container restarts automatically, it is usually not scraped when it is in the terminated state. Using the last terminated reason fixed this, because the metric continues to show that an OOM happened even when the container starts back up.

If this metric is only going to be reported when the container is in a terminated state, it seems like this use case will no longer be supported. Is there another way that we will be able to reliable alert on OOMs on kube-state-metrics:v2.0?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants