Overview
As infrastructure environments grow, monitoring dozens of servers from a single dashboard can become challenging. System administrators often need to focus on a specific group of servers, such as Grafana servers, PostgreSQL servers, application servers, or web servers.
To improve dashboard usability and troubleshooting efficiency, we implemented a Server Type filter in our Grafana System Monitoring Dashboard using Prometheus labels and Grafana variables.
Why Add a Server Type Filter?
Without filtering, administrators must manually search through all monitored servers to find relevant systems.
A Server Type filter helps by:
- Displaying only relevant servers
- Reducing dashboard clutter
- Simplifying troubleshooting
- Improving navigation
- Enabling faster performance analysis
- Making dashboards more scalable
Existing Dashboard
The System Monitoring Dashboard provides visibility into:
- Server Name
- Description
- Instance / IP Address
- Operating System
- Uptime
- CPU Usage
- Memory Usage
- Disk Usage
- Free Space
- Used Space
While this information is valuable, viewing all servers together can make troubleshooting difficult.
Step 1 – Add Server Type Labels in Prometheus
Assign a custom server_type label to each target in the Prometheus configuration.
Example:
- targets: ["10.10.10.11:9182"]
labels:
description: "Grafana Monitoring Server"
server_type: "Grafana"
- targets: ["10.10.10.12:9182"]
labels:
description: "PostgreSQL Database Server"
server_type: "PostgreSQL"
- targets: ["10.10.10.13:9182"]
labels:
description: "Application Server"
server_type: "Application"
- targets: ["10.10.10.14:9182"]
labels:
description: "Web Server"
server_type: "Web"
- targets: ["10.10.10.15:9182"]
labels:
description: "Loki Log Server"
server_type: "Loki"
After reloading Prometheus, the label becomes available in all metrics collected from those servers.
Step 2 – Create a Grafana Variable
Navigate to:
Dashboard Settings
→ Variables
→ Add Variable
Variable Configuration
Enable:
- Multi-value = ON
- Include All = ON
Grafana automatically creates a dropdown list.
Step 3 – Populate the Server Type Dropdown
The dropdown may contain:
All
Application
Grafana
Loki
PostgreSQL
Web
Users can now select a specific server category directly from the dashboard.
Step 4 – Update Dashboard Queries
Add the following filter to all Prometheus queries:
server_type=~“$server_type”
Example
Step 5 – Filter the Table Panel
For server inventory tables, add:
server_type=~“$server_type”
This ensures only matching servers appear in the table.
Example Scenario
Suppose an administrator receives an alert indicating high CPU utilization on database servers.
Instead of reviewing every monitored server:
Before
• View all servers
• Manually identify database hosts
• Search multiple panels
After
- Select Server Type = PostgreSQL
- Dashboard refreshes automatically
- CPU, Memory, Disk, and Uptime panels show only PostgreSQL servers
- Root cause analysis becomes significantly faster
Dashboard Benefits
Operational Benefits
Faster troubleshooting
Improved dashboard usability
Better server categorization
Faster incident response
Future Enhancements
Additional filters can be added using the same approach:
• Environment (Dev/Test/Prod)
• Location
• Application Name
• Business Unit
• Operating System
• Data Center
Combining multiple filters creates a highly interactive and scalable monitoring solution.
Conclusion
Adding a Server Type filter to a Grafana System Monitoring Dashboard is a simple enhancement that provides significant operational value. By leveraging Prometheus labels and Grafana variables, administrators can quickly focus on the systems that matter most, resulting in faster troubleshooting, cleaner dashboards, and a better monitoring experience overall.


