kube-state-metrics icon indicating copy to clipboard operation
kube-state-metrics copied to clipboard

feat: add kube_pod_container_status_last_terminated_timestamp metric

Open tetianakravchenko opened this issue 1 year ago • 6 comments

What this PR does / why we need it: Adds kube_pod_container_status_last_terminated_timestamp metric to report the time when container was last time terminated with the kube_pod_container_status_last_terminated_reason. This metric is useful for cases like getting the crash situation - as described in this issue: https://github.com/kubernetes/kube-state-metrics/issues/1805#issuecomment-1219182114

How does this change affect the cardinality of KSM: (increases, decreases or does not change cardinality) Adds a new metric in cases when the kube_pod_container_status_last_terminated_reason is reported

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged): Fixes #

tetianakravchenko avatar Dec 28 '23 14:12 tetianakravchenko

Welcome @tetianakravchenko!

It looks like this is your first PR to kubernetes/kube-state-metrics 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/kube-state-metrics has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. :smiley:

k8s-ci-robot avatar Dec 28 '23 14:12 k8s-ci-robot

/triage accepted /assign @rexagod

dashpole avatar Jan 11 '24 17:01 dashpole

@tetianakravchenko Tests seem to be failing here.

rexagod avatar Jan 17 '24 13:01 rexagod

@tetianakravchenko Tests seem to be failing here.

Hey @rexagod I've fixed tests, please have a look

tetianakravchenko avatar Jan 22 '24 15:01 tetianakravchenko

Hey @rexagod @mrueg could you please check this PR?

tetianakravchenko avatar Jan 30 '24 17:01 tetianakravchenko

This feature would be super helpful! Anything missing to get this in? :)

StephanErb avatar Mar 16 '24 08:03 StephanErb

Hey @rexagod could you please have another look on this PR?

tetianakravchenko avatar Mar 25 '24 14:03 tetianakravchenko

/lgtm

Thanks for your contribution!

mrueg avatar Mar 25 '24 14:03 mrueg

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mrueg, tetianakravchenko

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 avatar Mar 25 '24 14:03 k8s-ci-robot