kube-state-metrics
kube-state-metrics copied to clipboard
add exit code
What this PR does / why we need it:
Adds a new metric with the exit code from LastTerminantedStatus.
How does this change affect the cardinality of KSM: (increases, decreases or does not change cardinality)
A new metric will be added with the same cardinality as kube_pod_container_status_last_terminated_reason but with a value of the exit code
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 #
https://github.com/kubernetes/kube-state-metrics/issues/1481
The committers listed above are authorized under a signed CLA.
- :white_check_mark: login: ssabo / name: Shaun (8e713ae1f9aaed9d34e4c61915ee948adb60ddfb)
Welcome @ssabo!
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:
/hold
/retest
@ssabo: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.
In response to this:
/retest
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
/unhold
Thanks for the contribution. As discussed in one of the previous issues, I think this should be a new metric where the exit code is a value. Otherwise the cardinality impact will be very high.
If you need to filter by exit codes, you could always add == <exit_code> at the end of a PromQL expression.
Ah I hadn't realized that PromQL supported that grammar. That makes perfect sense to me, I'll make those updates.
This looks good, but the CI needs to be fixed before we can merge it.
@fpetkovski i'll probably get some some time to look at fixing the CI tests next week. In the meantime, what's the best way to run those locally? I don't think I have the capability to do /retest in this project yet and I was running into missing CLI tools when I had tried to invoke them manually. Any way to run them containerized? or just have to install those dependencies?
You can check directly what the CI commands are. It seems that make test-benchmark-compare and make doccheck are failing.
@fpetkovski sorry for the long delay. Life got busy unexpectedly. Tests should be all fixed up now
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: fpetkovski, ssabo
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [fpetkovski]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment