- 
                Notifications
    You must be signed in to change notification settings 
- Fork 2.1k
Description
What would you like to be added:
I would like custom state metrics to be able to parse resource duration fields into metric value. For example, they should be able to parse duration: 1h into 3600.
Why is this needed:
Some resources (like cert-manager certificates) store valuable information, such as how long a certificate is valid for, as a duration string.
Describe the solution you'd like
I would like KSM to support parsing these values, similarly to other values, as described here.
Additional context
This is not as trivial as adding a three line if this can be parsed; set the metric to the time.ParseDuration value. Custom resources already support parsing resource quantities such as 250m (i.e. 1/4 of a CPU), which is indistinguishable from the duration 250m (i.e. four hours and ten minutes). The config likely would need to support explicitly stating how a metric should be converted (which is probably desirable anyway).
Metadata
Metadata
Assignees
Labels
Type
Projects
Status