Guide to Using Grafana Stat Panel for Monitoring: Text and Background Modes, Configuration Steps
This tutorial explains how to create and configure Grafana Stat panels—including text and background modes, threshold‑based coloring, unit settings, and Markdown/HTML text panels—to visualize metrics such as node uptime, CPU cores, and total memory on a dashboard.
The Stat panel can display a large numeric value with an optional background color, and thresholds can be used to control the background or color value.
Note: This panel replaces the deprecated Singlestat panel in Grafana 7.0.
Below we use this panel to monitor several metrics, such as node uptime, CPU core count, and total memory size.
Text Mode
First create an empty panel and select the Stat panel:
Add a query for node uptime:
In the panel editor you can choose the orientation (horizontal or vertical) and the text display mode (Value, Name, both, or none). Here we keep the default Auto . The color mode offers three options: None , Value , and Background . The Value option displays colors based on thresholds, while Background changes the panel background color.
Set the unit to seconds (s) and choose the color mode From thresholds (by value) , then define thresholds (e.g., 1 and 3) with different colors. Since the current value is 5, which exceeds the threshold 3, the text appears green.
Similarly, add a Stat panel for CPU core count and another for total memory:
All panel properties can be adjusted to meet specific needs.
Background Mode
In addition to the pure text mode, you can display values with a background color. Use the Stat panel, set the text mode to Value and name , and choose the color mode Background :
Configure thresholds to control the displayed colors, and you can also switch the previous CPU and partition usage panels to this background mode. The final combined view looks like this:
These options let you choose the most suitable panel for each metric.
Text Panel
Besides the panels that query data, Grafana also provides a Text panel that does not require a query and can render content in Markdown or HTML , offering great flexibility.
To use it, create a new dashboard, add an empty panel, and select the Text panel:
Enter the desired content in the text box. For example, using Markdown:
# This is a level‑1 heading
## This is a level‑2 heading
This is body text, **bold**, `code`.
> A blockquote.
The rendered result appears as follows:
Because HTML is also supported, you can add custom styled links, for instance:
<span style="color:green">> This is a navigation title</span><br/><br/>
<a href="http://192.168.31.46:3000/d/oq26nAFnz/nodejie-dian-jian-kong?orgId=1" style="color: yellow">Bar Dashboard</a>
<a href="http://192.168.31.46:3000/d/oq26nAFnz/nodejie-dian-jian-kong?orgId=1" style="color: green">Table Dashboard</a>
<br/><br/>
<a href="http://192.168.31.46:3000/d/oq26nAFnz/nodejie-dian-jian-kong?orgId=1" style="color: red">CPU Usage</a>The rendered HTML looks like this:
You can also group related panels using a Row to create a navigation dashboard for complex monitoring scenarios:
This approach helps build an operational homepage that improves efficiency when dealing with many monitoring dashboards.
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.