Skip to content

fix(alloy): use the Kubernetes node name as node_uname_info's nodename - #98

Merged
jtslear merged 1 commit into
mainfrom
skarbek/nodename-from-k8s-node
Nov 3, 2026
Merged

jtslear merged 1 commit into
mainfrom
skarbek/nodename-from-k8s-node

Conversation

@jtslear

@jtslear jtslear commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

node-exporter reports the OS hostname in node_uname_info's nodename label. When nodes are named by instance ID (EKS here: i-0a31ce555f738526a), the hostname is ip-172-16-25-159.us-east-2.compute.internal, which never matches kube_node_info's node.

The Kubernetes / Views / Nodes dashboard (dotdc, grafana.com 15759) finds a node's instance with label_values(node_uname_info{nodename=~"(?i:($node)(\.[a-z0-9.-]+)?)"}, instance). With no match the variable is empty and every node_* panel is blank. On the dogfood-stable Grafana, 46 of 52 panel queries were empty; with instance forced to the right value only 5 were, all legitimately so.

This sets nodename from the node label that pod discovery already attaches to node_uname_info, in prometheus.relabel "pods".

  • Behaviour change: nodename on node_uname_info is now the Kubernetes node name rather than the OS hostname. The hostname is still in instance (as the pod IP) and in kube_node_info's internal_ip. Noted in the CHANGELOG.
  • Rule is scoped to node_uname_info only.
  • compiled/resources.yaml regenerated.

🤖 Generated with Claude Code

@jtslear
jtslear requested a review from dannykopping as a code owner November 3, 2026 16:30
node-exporter reports the OS hostname in node_uname_info's nodename. When
nodes are named by instance ID, that never matches kube_node_info's node,
so dashboards that join the two (such as Kubernetes / Views / Nodes) find
no instance and every node_* panel is empty. Set nodename from the node
label the pod target already carries.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@jtslear
jtslear force-pushed the skarbek/nodename-from-k8s-node branch from 350d255 to dbaa9f7 Compare November 3, 2026 17:32
@jtslear
jtslear merged commit a57af6e into main Nov 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants