The new GRANAFA K8S plug K8S NODE chart does not show Problem Solution

Original: https://www.wchao.site/archives/granafa-k8s

Additional references: https://blog.csdn.net/bbwangj/article/details/82658419

k8s node chart does not show the problem. 2Collect node information, node-exporter dependent http exposed interfaces. Cpu utilization for the interface, for example, in the following format:

node_cpu_seconds_total{beta_kubernetes_io_arch="amd64",beta_kubernetes_io_os="linux",cpu="9",instance="slave1",job="kubernetes-nodes",kubernetes_io_arch="amd64",kubernetes_io_hostname="slave1",kubernetes_io_os="linux",mode="user"}

Formula cpu dashboard data acquired as follows:

3

K8s Node template can be seen inside the nodename field to get data from different nodes, but node-exporter exposed interface, and no nodename field, thus leading to the template can not find the data, making it impossible to draw graphics.

Solutions are as follows:

Click on the Settings button k8s Node dashboard page, select the Variable menu

4

You can see there are currently four variables, click New to create a new variable upper right corner

When you click Save, it will pop up a prompt box. Select to overwrite. 5

Note that the above figurenode_boot_time 要写成 node_boot_time_seconds,即

label_values(node_boot_time_seconds,instance)

Until the following preview of values ​​show host list when considered normal

Back to k8s Node dashboard page, you can see one more instance column

Then edit each panel, the quoted nodename place instead instance. Here to cpu panel as an example: 8

We can see, modified graphics normal show. Finally, the new version still does not display properly, but not a big problem, mainly due to some field name has been replaced, the following is part of the property that changed correspondence:

* node_cpu ->  node_cpu_seconds_total
* node_memory_MemTotal -> node_memory_MemTotal_bytes
* node_memory_MemFree -> node_memory_MemFree_bytes
* node_filesystem_avail -> node_filesystem_avail_bytes
* node_filesystem_size -> node_filesystem_size_bytes
* node_disk_io_time_ms -> node_disk_io_time_seconds_total
* node_disk_reads_completed -> node_disk_reads_completed_total
* node_disk_sectors_written -> node_disk_written_bytes_total
* node_time -> node_time_seconds
* node_boot_time -> node_boot_time_seconds
* node_intr -> node_intr_total
* node_filesystem_free -> node_filesystem_free_bytes
* node_filesystem_size -> node_filesystem_size_bytes
* node_disk_bytes_read-> node_disk_read_bytes_total
* node_disk_bytes_written -> node_disk_written_bytes_total
* node_disk_reads_completed->node_disk_reads_completed_total
* node_disk_writes_completed  ->
		node_disk_writes_completed_total
* node_network_receive_bytes  ->
		node_network_receive_bytes_total
* node_network_transmit_bytes ->
		node_network_transmit_bytes_total
* node_network_receive_errs   ->
		node_network_receive_errs_total

Give a man a fish than giving the fishing. If the property is not listed above, you copy it to prometheus here usually appear different wording to the effect that the same attribute name. This is corresponding. 9Finally, attach a chart success. 7

Guess you like

Origin www.cnblogs.com/robinunix/p/11280883.html