Skip to content
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

[bug] Failed to display node metrics #37

Closed
fcecagno opened this issue Feb 6, 2023 · 5 comments
Closed

[bug] Failed to display node metrics #37

fcecagno opened this issue Feb 6, 2023 · 5 comments
Assignees
Labels
bug Something isn't working released

Comments

@fcecagno
Copy link
Contributor

fcecagno commented Feb 6, 2023

Describe the bug

This is the way variables are configured on k8s-views-nodes.json:

...
node = label_values(kube_node_info, node)
instance = label_values(node_uname_info{nodename=~"(?i:($node))"}, instance)

In OKE, kube_node_info looks like this:

{__name__="kube_node_info", container="kube-state-metrics", container_runtime_version="cri-o://1.25.1-111.el7", endpoint="http", instance="10.244.0.40:8080", internal_ip="10.0.107.39", job="kube-state-metrics", kernel_version="5.4.17-2136.314.6.2.el7uek.x86_64", kubelet_version="v1.25.4", kubeproxy_version="v1.25.4", namespace="monitoring", node="10.0.107.39", os_image="Oracle Linux Server 7.9", pod="monitoring-kube-state-metrics-6fcd4d745c-txg2k", pod_cidr="10.244.1.0/25", provider_id="ocid1.instance.oc1.sa-saopaulo-1.xxx", service="monitoring-kube-state-metrics", system_uuid="d6462364-95bf-4122-a3ab-xxx"}

And node_uname_info looks like this:

node_uname_info{container="node-exporter", domainname="(none)", endpoint="http-metrics", instance="10.0.107.39:9100", job="node-exporter", machine="x86_64", namespace="monitoring", nodename="oke-cq2bxmvtqca-nsdfwre7l3a-seqv6owhq3a-0", pod="monitoring-prometheus-node-exporter-n6pzv", release="5.4.17-2136.314.6.2.el7uek.x86_64", service="monitoring-prometheus-node-exporter", sysname="Linux", version="#2 SMP Fri Dec 9 17:35:27 PST 2022"}

For this example, node=10.0.107.39, but when I query node_uname_info{nodename=~"(?i:($node))"}, it doesn't return anything, because nodename doesn't match the internal IP address of the node.
As a result, no node metrics is displayed.

How to reproduce?

No response

Expected behavior

No response

Additional context

Modifying the filter https://github.com/dotdc/grafana-dashboards-kubernetes/blob/master/dashboards/k8s-views-nodes.json#L3747-L3772 to use node_uname_info{instance="$node:9100"} fixes the issue.

@fcecagno fcecagno added the bug Something isn't working label Feb 6, 2023
@dotdc
Copy link
Owner

dotdc commented Feb 20, 2023

Hi @fcecagno, thank you for reporting this, will look at it this week!

@fcecagno
Copy link
Contributor Author

Hi @dotdc , I'm pretty sure I need to play with relabeling on node-exporter to make it work properly. I'll post here when I find the solution.

@staniondaniel
Copy link

Hey
I am seeing the same problem. I think modifying the filter is the best solution. I other prometheus templates I see a filter like this being used:
label_values(node_uname_info{job="node-exporter", sysname!="Darwin"}, instance)

Modifying the labels may be a bit complicated for people using predefined monitoring solutions like kube-prometheus-stack

Regards

@fcecagno
Copy link
Contributor Author

fcecagno commented Mar 9, 2023

Modifying the labels may be a bit complicated for people using predefined monitoring solutions like kube-prometheus-stack

That's precisely my case, and I didn't succeed modifying the labels, so I believe updating to a more generic filter might be a better solution.

fcecagno added a commit to fcecagno/grafana-dashboards-kubernetes that referenced this issue Mar 26, 2023
@dotdc dotdc closed this as completed in 50a04c6 Mar 31, 2023
@dotdc
Copy link
Owner

dotdc commented Apr 25, 2024

🎉 This issue has been resolved in version 1.1.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@dotdc dotdc added the released label Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

No branches or pull requests

3 participants