How to Set Up Grafana Monitoring for Minecraft
Step-by-step setup for grafana monitoring on a minecraft server using Prometheus, UnifiedMetrics or Plan, with dashboards for TPS, RAM, players, and more.
What Grafana Monitoring Gives You
Console output tells you what is happening right now. Grafana monitoring for your minecraft server tells you what happened over the last hour, day, or month. It graphs TPS, memory usage, player count, chunk load times, entity counts, and any other metric you expose. When a player says "the server was laggy last night," you can pull up the exact time range, see the TPS dip, correlate it with a RAM spike, and identify whether the cause was a plugin, a griefer loading chunks, or a garbage collection stall.
The standard stack is: a Minecraft plugin that collects metrics, Prometheus that stores them as time-series data, and Grafana that visualizes them in dashboards. We will set up all three.
Step 1: Install Prometheus
Prometheus is a time-series database that scrapes metrics from endpoints at regular intervals. Download the latest release from the Prometheus website, extract it, and create a config file:
# prometheus.yml
global:
scrape_interval: 15s
scrape_configs:
- job_name: 'minecraft'
static_configs:
- targets: ['localhost:9225']
labels:
server: 'survival'
This tells Prometheus to scrape metrics from port 9225 every 15 seconds. Start Prometheus with ./prometheus --config.file=prometheus.yml. It runs on port 9090 by default.
For grafana monitoring of a minecraft server with multiple instances, add more targets under static_configs with different labels so you can filter by server in your dashboards.
Step 2: Install a Metrics Plugin
You need a plugin that exposes Minecraft data in a format Prometheus understands (the Prometheus exposition format). The two best options are:
UnifiedMetrics
UnifiedMetrics is purpose-built for Prometheus and Grafana. It exposes TPS, MSPT, player count, world size, loaded chunks, entity count, and JVM stats. Install the JAR, and it starts serving metrics on port 9225 immediately.
# plugins/UnifiedMetrics/config.yml
metrics:
server:
tps: true
mspt: true
players: true
world:
entities: true
chunks: true
jvm:
memory: true
gc: true
threads: true
exporters:
prometheus:
enabled: true
port: 9225
Plan (Player Analytics)
Plan is a broader analytics plugin that also exports to Prometheus. It tracks per-player session data, server performance, and plugin-specific metrics. It includes its own web dashboard, but for grafana monitoring on your minecraft server, enable the Prometheus exporter in Plan's config.
Step 3: Install and Configure Grafana
Grafana is the visualization layer. Install it from the official repository or run it in Docker:
docker run -d --name=grafana -p 3000:3000 grafana/grafana-oss
Open http://your-server-ip:3000 in your browser (default login is admin/admin). Add Prometheus as a data source: go to Configuration, Data Sources, Add data source, select Prometheus, and set the URL to http://localhost:9090.
Step 4: Build Your Dashboard
You can build panels from scratch or import a community dashboard. For grafana monitoring of a minecraft server, the community dashboard ID 14756 (UnifiedMetrics) provides a solid starting point. Import it via Dashboards, Import, and enter the ID.
Key panels to include:
- TPS over time: A line graph of
mc_tps. Add a threshold line at 19.0 so dips are visually obvious. - MSPT (milliseconds per tick): Shows how long each tick takes. Spikes above 50ms mean the server cannot maintain 20 TPS.
- RAM usage: Graph
jvm_memory_used_bytesagainstjvm_memory_max_bytes. A sawtooth pattern is normal (allocation, GC, repeat). A steadily rising baseline means a memory leak. - Player count: Correlate player count with TPS to understand your server's capacity.
- Entity count per world: Identifies worlds with runaway entity counts from broken farms.
- GC pause duration: Long GC pauses cause lag spikes. Graph
jvm_gc_pause_secondsto spot them.
Step 5: Set Up Alerts
Grafana supports alerting rules that notify you when metrics cross thresholds. Configure alerts for:
- TPS below 18 for more than 2 minutes
- RAM usage above 90% for more than 5 minutes
- Player count dropping to 0 unexpectedly (possible crash)
- MSPT exceeding 100ms (severe lag)
Send alerts to Discord via webhook, email, or Slack. In Grafana's Alerting section, create a contact point with your Discord webhook URL, then attach it to your alert rules.
Combine grafana monitoring for your minecraft server with crash detection scripts for full coverage. Grafana catches the slow degradation that logs miss, while crash scripts catch the sudden failures that Grafana cannot report if the server is down.
Performance Impact
The metrics collection overhead is minimal. UnifiedMetrics adds less than 0.5ms per tick on modern hardware. Prometheus scraping every 15 seconds generates negligible network traffic. Grafana itself runs on a separate process (or machine) and does not affect the Minecraft server. The storage cost is roughly 1 to 2 GB per month of retained metrics data for a single server.
For servers already using Spark for profiling, Grafana complements rather than replaces it. Spark gives you deep, on-demand profiling. Grafana gives you continuous, historical monitoring. Use both.
All these admin tools work out of the box on Astroworld Hosting. Full file access, console, and scheduling on every plan.