Skip to content

6. Custom dashboards

Vincenzo Reina edited this page May 15, 2025 · 7 revisions

ServerPulse Custom Dashboards Guide

This guide covers the default dashboards provided by ServerPulse and how to create custom dashboards in Grafana for all supported platforms: Bukkit/Paper, Velocity, and Fabric.

Default Dashboards

ServerPulse provides pre-configured dashboards for each supported platform:

Bukkit/Paper Dashboards

  • Bukkit Server Metrics: TPS, memory, disk space, entities, chunks
  • Bukkit Players and Ping: Player count and ping statistics

Velocity Dashboards

  • Velocity System Metrics: Memory and disk usage
  • Velocity Players and Ping: Player count and ping statistics

Fabric Dashboards

  • Fabric Server Metrics: TPS, memory, disk space, entities, chunks
  • Fabric Players and Ping: Player count and ping statistics

Creating Simple Custom Dashboards

Basic Dashboard Creation

  1. In Grafana, click "+ New Dashboard"
  2. Click "Add visualization"
  3. Select "InfluxDB_v2_Flux" data source
  4. Create a basic query:
from(bucket: "metrics_db")
  |> range(start: v.timeRangeStart)
  |> filter(fn: (r) => r._measurement == "minecraft_stats")
  |> filter(fn: (r) => r._field == "your_metric_here")
  |> filter(fn: (r) => r.server == "your-server-name")

Available Metrics

Bukkit/Paper and Fabric Metrics

  • TPS: tps_1m, tps_5m, tps_15m
  • World data: entities_count, loaded_chunks

Common Metrics (All Platforms)

  • Memory: used_memory, available_memory
  • Disk: total_disk_space, usable_disk_space
  • Players: players_online
  • Ping: min_ping, max_ping, avg_ping

Quick Query Examples

TPS Graph (Bukkit/Paper or Fabric)

from(bucket: "metrics_db")
  |> range(start: v.timeRangeStart)
  |> filter(fn: (r) => r._measurement == "minecraft_stats")
  |> filter(fn: (r) => r._field == "tps_1m")
  |> filter(fn: (r) => r.server == "your-server-name")

Online Players (All Platforms)

from(bucket: "metrics_db")
  |> range(start: v.timeRangeStart)
  |> filter(fn: (r) => r._measurement == "minecraft_stats")
  |> filter(fn: (r) => r._field == "players_online")
  |> filter(fn: (r) => r.server == "your-server-name")

Memory Usage (All Platforms)

from(bucket: "metrics_db")
  |> range(start: v.timeRangeStart)
  |> filter(fn: (r) => r._measurement == "minecraft_stats")
  |> filter(fn: (r) => r._field == "used_memory")
  |> filter(fn: (r) => r.server == "your-server-name")

Average Ping (All Platforms)

from(bucket: "metrics_db")
  |> range(start: v.timeRangeStart)
  |> filter(fn: (r) => r._measurement == "minecraft_stats")
  |> filter(fn: (r) => r._field == "avg_ping")
  |> filter(fn: (r) => r.server == "your-server-name")

World Entities (Bukkit/Paper or Fabric)

from(bucket: "metrics_db")
  |> range(start: v.timeRangeStart)
  |> filter(fn: (r) => r._measurement == "minecraft_stats")
  |> filter(fn: (r) => r._field == "entities_count")
  |> filter(fn: (r) => r.world != "")
  |> filter(fn: (r) => r.server == "your-server-name")

Multi-Server Dashboard

To show metrics from multiple servers:

  1. Add a dashboard variable:

    • Click the gear icon (Dashboard settings)
    • Select "Variables"
    • Click "Add variable"
    • Set Name: server
    • Set Type: Query
    • Set Data source: InfluxDB_v2_Flux
    • Set Query:
    import "influxdata/influxdb/schema"
    
    schema.measurementTagValues(
      bucket: "metrics_db",
      measurement: "minecraft_stats",
      tag: "server"
    )
    
    • Click "Update" and "Save dashboard"
  2. In your queries, replace the server name with the variable:

from(bucket: "metrics_db")
  |> range(start: v.timeRangeStart)
  |> filter(fn: (r) => r._measurement == "minecraft_stats")
  |> filter(fn: (r) => r._field == "players_online")
  |> filter(fn: (r) => r.server == "${server}")

Platform Comparison Dashboard

You can create a dashboard that compares metrics across different platforms. Here's an example query that shows TPS for all Bukkit and Fabric servers:

from(bucket: "metrics_db")
  |> range(start: v.timeRangeStart)
  |> filter(fn: (r) => r._measurement == "minecraft_stats")
  |> filter(fn: (r) => r._field == "tps_1m")
  |> filter(fn: (r) => r.server =~ /^(bed|fabric)/)

World-Specific Metrics Dashboard

For Bukkit/Paper and Fabric, you can create a dashboard focusing on specific worlds:

  1. Add a world variable:

    • Create a variable named world
    • Use this query:
    import "influxdata/influxdb/schema"
    
    schema.measurementTagValues(
      bucket: "metrics_db",
      measurement: "minecraft_stats",
      tag: "world"
    )
    
  2. Create queries that filter by world:

from(bucket: "metrics_db")
  |> range(start: v.timeRangeStart)
  |> filter(fn: (r) => r._measurement == "minecraft_stats")
  |> filter(fn: (r) => r._field == "entities_count")
  |> filter(fn: (r) => r.world == "${world}")
  |> filter(fn: (r) => r.server == "${server}")

Advanced Dashboard Tips

Using Annotations for Events

You can add annotations to mark important events:

  1. Create a new annotation in Grafana
  2. Add a query to detect when TPS drops below a threshold:
from(bucket: "metrics_db")
  |> range(start: v.timeRangeStart)
  |> filter(fn: (r) => r._measurement == "minecraft_stats")
  |> filter(fn: (r) => r._field == "tps_1m")
  |> filter(fn: (r) => r.server == "${server}")
  |> filter(fn: (r) => r._value < 15)

Creating Threshold Alerts

To create an alert when metrics reach critical values:

  1. Edit a panel
  2. Go to "Alert" tab
  3. Click "Create Alert Rule"
  4. Configure conditions (e.g., alert when TPS < 15 for 5 minutes)

Useful Panel Types

  • Gauge: Great for current TPS or memory usage
  • Stat: Shows single values like player count
  • Time Series: For tracking metrics over time
  • Bar Gauge: Comparing values across servers
  • Heatmap: Visualizing ping distribution

Example: Comprehensive Multi-Platform Dashboard

A complete dashboard might include:

  1. Header Row: Server selector and key stats (online players, TPS status)
  2. Performance Row:
    • TPS graphs for Bukkit/Paper and Fabric servers
    • Memory usage for all servers
    • Disk space remaining
  3. Players Row:
    • Player count across all platforms
    • Ping statistics
  4. Per-World Row (for Bukkit/Paper and Fabric):
    • Entity counts
    • Chunk loading

Exporting and Sharing Dashboards

To share your custom dashboard:

  1. Click the share icon in the dashboard
  2. Select "Export" tab
  3. Click "Save to file"
  4. The JSON file can be imported to other Grafana instances

Troubleshooting Dashboard Issues

  • No data points: Check server tags in configuration
  • Missing metrics: Verify the platform supports that metric
  • Query errors: Ensure field names are correct (case sensitive)
  • Server not appearing in variables: Check if the server is sending data