Creating and Transforming Grafana Table Panels for Server Resource Monitoring
This guide demonstrates how to create a Grafana Table panel to monitor server resources, add multiple queries, merge them using the Transform feature, customize fields and units, and organize rows for a comprehensive dashboard view.
Previously we learned how to use time‑series based panels; now we explore the Table panel , which offers flexible visualization for time series, tables, and raw JSON data, along with date formatting, value formatting, and coloring options.
Adding a Table Panel
Using a server‑resource monitoring example, add an empty panel in the Dashboard, open the panel editor, and select the Table panel type.
First, display node information using the node_uname_info metric; add the following query in the query area:
Next, add a query for node boot time using the node_boot_time_seconds metric with the expression sum(time() - node_boot_time_seconds{job="node-exporter"}) by (instance) .
Additional resource statistics such as total memory, CPU count, load, and bandwidth are added with the following queries:
Total memory: node_memory_MemTotal_bytes{job="node-exporter"}
CPU cores: count(node_cpu_seconds_total{job="node-exporter", mode='system'}) by (instance)
5‑minute load: node_load5{job="node-exporter"}
Connection count: node_netstat_Tcp_CurrEstab{job="node-exporter"}
Download bandwidth: max(rate(node_network_receive_bytes_total{job="node-exporter"}[$interval])*8) by (instance)
Upload bandwidth: max(rate(node_network_transmit_bytes_total{job="node-exporter"}[$interval])*8) by (instance)
Additional queries can be added as needed.
Table Transformation
After displaying all queries as separate tables, use the Transform feature to merge them into a single table. In the Transform tab, select the Merge option.
The Merge transformer combines multiple series or tables into one, aligning values into the same rows. After selecting Merge , the separate query results are consolidated.
Some data may be missing because the queries include the __name__ label, which causes loss during merging. Append - 0 to each query to drop this label, e.g., node_uname_info{job="node-exporter"} - 0 , and do the same for the other queries.
Even after merging, the table header may be unclear or contain unnecessary columns. Use another Transform called Organize fields to reorder, hide, or rename fields.
Field Overrides
To add units to columns, apply field overrides. For the "runtime" column, set the unit to seconds (s) to automatically convert the values. For the "total memory" column, set the unit to bytes (IEC) .
Column display can also be customized with background colors or gauges by setting the Cell display mode . For example, configure the CPU usage and memory usage columns to use the LCD gauge mode.
Adding Rows
Define a total variable to represent the total number of monitored hosts, but hide it by setting its visibility to Variable .
Create a variable for the host name using the query node_uname_info{instance=~"$host"} , which references the previously defined $host variable.
Add two empty Row entries, place the panel in different rows, and assign titles that can include the defined variables.
The final result is a complete node‑monitoring dashboard displaying all desired metrics in a single, well‑organized table.
DevOps Cloud Academy
Exploring industry DevOps practices and technical expertise.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.