phit / PrometheusExporter

Minecraft Prometheus Exporter for Sponge
Download

Prometheus Exporter for Sponge

A Sponge plugin which exports Minecraft server stats for Prometheus.

Quick Start

Drop the the plugin jar into your servers mods directory and start your server.

After startup, the Prometheus metrics endpoint should be available at localhost:9225/metrics (assuming localhost is the server hostname).

The metrics port can be customized in the plugin’s config file (a default config will be created after the first use).

Prometheus configuration

Add the following job to the scrape_configs section of your Prometheus configuration:

Single Server

- job_name: 'minecraft'
  static_configs:
    - targets: ['localhost:9225']

Multiple Server

  - job_name: 'minecraft'
    static_configs:
      - targets: ['localhost:9225']
        labels:
          group: 'server1'
      - targets: ['localhost:9226']
        labels:
          group: 'server2'
      - targets: ['localhost:9227']
        labels:
          group: 'server3'

In the grafana json add {group="serverX"} to each search query.

Grafana Dashboard

You can grab the leatest grafana.json on GitHub.

  1. Navigate to Grafana -> Dashboards -> Import
  2. Paste in or upload minecraft-grafana.json
  3. Update “JVM Memory Used” to reflect your server max memory (Default 8G)
  4. Edit (bottom right widget) -> Options -> Gauage -> Max

Dashboard Example

Available metrics

These are the stats that are currently exported by the plugin.

LabelDescription
mc_players_totalOnline and Max Online players
mc_tpsOverall tps
mc_loaded_chunksChunks loaded per world
mc_players_onlineOnline players per world
mc_entitiesEntities loaded per world
mc_tile_entitiesTile Entities loaded per world
mc_jvm_memoryJVM memory usage

Original Bukkit version by sladkoff https://github.com/sladkoff/minecraft-prometheus-exporter

Category: Admin Tools

Published on Mar 7, 2017

1889 views

143 total downloads

Licensed under MIT

Pages

Members