Our current Grafana dashboard layout displays all server nodes as IP addresses which is difficult for us to keep track of and we prefer to have it as a hostname (or FQDN) display in the drop down.
Any suggestions on how to get that done would be very helpful.
While I do believe it has to be done on the Node exporter(Prometheus) config but I am not sure what configuration has to go in to get that done.
I am just starting myself so I am far from expert, but my experience is that yes in almost all cases you need to track the data you want in Prometheus first. Look into the node_uname_info defined query. There is a hostname “label” there that you will then have to assign to a variable in Grafana. There may be another way to work with non-numeric data in Grafana but I don’t know enough to speak to that.
My issue is if you want to then use that string in Grafana you are going to run into some limitations.
In your Prometheus scrape_config, do you specify your target hosts by DNS name or by IP? If you specify them with hostname:port (example: “server01:9100”), you will see hostnames in instance label values instead of IP addresses. Otherwise you can add more labels in the Prometheus configuration.
The role attribute belongs to either kubernetes_sd_config or openstack_sd_config. If you want this configuration to monitor your Kubernetes nodes, yes you need to change the role to “node”.
The other possibilities are “service”, “pod”, “endpoint” and “ingress”, which are all Kubernetes objects hosted on the nodes and you may want to monitor them too eventually.
The relabel config you pasted is a good idea. It creates an “address” label with just the address part from the “instance” label (without the colon and port number).
The Kubernetes service discovery returns this meta-label for nodes: __meta_kubernetes_node_name. You can use it in a relabel_config too.
Thanks for the detailed response!
So, I prefer to have role as ‘node’ since we are looking at having hostnames in the Node (server) dropdown.
So can both relabel configs be used together? (one to get the meta_kube_node_name as hostnames and the second one for hostname display without colon and port? ) - Like this??