Support for Custom Labels in kube_node_* Metrics #2608
Labels
kind/feature
Categorizes issue or PR as related to a new feature.
triage/accepted
Indicates an issue or PR is ready to be actively worked on.
What would you like to be added:
The ability to include custom labels such as
node.k8s.io/pool
inkube_node_*
metrics.Why is this needed:
This enhancement would enable tracking nodes as a group, making it easier to analyze and filter them based on custom attributes. Other similar use cases include labeling nodes with
nvidia.com/gpu_type
, etc.With this change a node metric will look something like below:
kube_node_status_condition{node=<nodename>,label_node_k8s_io_pool=<name>,condition=<ReadyForPods>,status="true"} 1
Describe the solution you'd like
I attempted to achieve this using
CustomResourceStateMetrics
, but it didn't work as expected due to multiple node conditions being present. It might have worked if there were only a single node condition per node.I also tried modifying the metric name by incorporating the condition type, e.g.,
kube__v1_Node_kube_node_status_condition_NetworkUnavailable
, but this approach resulted in duplicate metrics.Here's is an example
The configuration resulted in duplicate metrics, as shown below:
Additional context
Would appreciate guidance on the best approach to incorporate custom labels into kube_node_* metrics.
The text was updated successfully, but these errors were encountered: