-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[k8sclusterreceiver] add k8s.node.info metric #24835
Comments
Pinging code owners: See Adding Labels via Comments if you do not have permissions to add labels yourself. |
I don't believe OTel spec have any recommendations to move the Prometheus info metrics to OTel metrics. I believe those should be added as optional resource attributes to existing metrics |
@dmitryax that would be non-ideal implementation for backends such as Prometheus where storing these attributes on a separate metric reduces size of the index while still allows joining with the other metrics. |
Accommodating all possible metric backend peculiarities is not OTel's goal. These info metrics exist in the Prometheus ecosystem because there is no other way to do it in Prometheus. This particular use case can be resolved by a collector processor or another Prometheus exporter capability that provides an option to move resource attributes into a separate fake metric instead of emitting them as native OTel metrics. |
Apparently prometheus exporter already exposes resource attributes in the |
I've played around with adding a couple of resource attributes to node metrics and prometheus exporter #26351 With
Example metric:
While target_info looks like this:
Without Metrics
target_info looks like this:
I think we need to figure out what to do about this in prometheus exporter or k8s cluster receiver. Would be great to get target_info's for each node, pod, etc with resource attributes. |
I played around creating a
Gives you these metrics:
Only new |
**Description:** <Describe what has changed.> <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> Add optional k8s.kubelet.version, k8s.kubeproxy.version node resource attributes Doing some actual testing with kind with k8s_cluster receiver and prometheus exporters. ``` k8s_cluster: node_conditions_to_report: [Ready, MemoryPressure] allocatable_types_to_report: [cpu, memory] resource_attributes: k8s.kubelet.version: enabled: true k8s.kubeproxy.version: enabled: true ``` and prometheus exporter: ``` prometheus: resource_to_telemetry_conversion: enabled: true endpoint: 0.0.0.0:9090 ``` Example metric: ``` k8s_node_allocatable_cpu{k8s_kubelet_version="v1.25.3",k8s_kubeproxy_version="v1.25.3",k8s_node_name="kind-control-plane",k8s_node_uid="09b55a47-87cb-4790-8834-2341d683999d",opencensus_resourcetype="k8s"} 8 ``` **Link to tracking Issue:** #24835 **Testing:** <Describe what testing was performed and which tests were added.> - added unit tests - manua ltest with kind **Documentation:** <Describe the documentation added.> - generated
Component(s)
receiver/k8scluster
Is your feature request related to a problem? Please describe.
I would like to have a metric similar to kube_node_info of kube-state-metrics, see https://github.com/kubernetes/kube-state-metrics/blob/main/internal/store/node.go#L110-L136
Example from kube-state-metrics:
This helps me to correlate issues with nodes (kernel version, cri version, etc) .
Describe the solution you'd like
Adding a gauge
k8s.node.info
metric that always equals to 1.I would add this information as resource attributes:
Describe alternatives you've considered
Additional context
No response
The text was updated successfully, but these errors were encountered: