feat: Add HorizontalPodAutoscaler created and deletionTimestamp info into metrics
What this PR does / why we need it:
For some reason, there is no kube_horizontalpodautoscaler_created metric for HPA with creation timestamp information, PR is about to add it as a similarity to other objects.
Also, add kube_horizontalpodautoscaler_deletion_timestamp metrics to catch the deletion timestamp field.
How does this change affect the cardinality of KSM: (increases, decreases or does not change cardinality)
None
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 #
The committers listed above are authorized under a signed CLA.
- :white_check_mark: login: IgorIgnatevBolt / name: Igor Ignatev (8fd0417aa2809c2672a765abd78eb27ec2077bf2)
Welcome @IgorIgnatevBolt!
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:
/triage accepted @rexagod can you PTAL? Thanks
Just a small update, also added kube_horizontalpodautoscaler_deletion_timestamp metrics because I need this and fixed the formatting for the table docs
All commits were squashed into one.
Hi, could you share the use case of kube_horizontalpodautoscaler_created?
If only want to the created timestamp, could we use kube_horizontalpodautoscaler_info?
@CatherineF-dev I'd like to detect resources (for example) older than 7 days with special conditions (eq, last apply label exists or any other), and the created timestamp is very useful in expression for this because the date is defined permanently, initially I tried to use kube_horizontalpodautoscaler_info by measuring the presence of this metric in the required period, unfortunately it cannot be used because it very depends on tsdb where metrics collected and if we don't have this metric for all perion that we want to measure (like lower retention perion) then we cannot trigger alert. All other resources collected by kube-state-metrics have a created timestamp, but for some reason not hpa. I would like the ability to work equally with all resources.
Hi @CatherineF-dev, do you need any more information about PR or anything else that can help you move forward?
/hold for further comments. /lgtm
Thanks for your contribution!
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: IgorIgnatevBolt, mrueg
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~OWNERS~~ [mrueg]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
/hold cancel