Adding a Server Type Filter to a Grafana System Monitoring Dashboard

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:

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

  1. Select Server Type = PostgreSQL
  2. Dashboard refreshes automatically
  3. CPU, Memory, Disk, and Uptime panels show only PostgreSQL servers
  4. Root cause analysis becomes significantly faster

Dashboard Benefits
Operational Benefits
:white_check_mark: Faster troubleshooting
:white_check_mark: Improved dashboard usability
:white_check_mark: Better server categorization
:white_check_mark: 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.