PrometheusExporter - Minecraft Prometheus Exporter for Sponge

This is a discussion topic for the Ore project, PrometheusExporter. View the full project on Ore for downloads and more information.


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

Available metrics

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

Label Description
mc_players_total Online and Max Online players
mc_tps Overall tps
mc_loaded_chunks Chunks loaded per world
mc_players_online Online players per world
mc_entities Entities loaded per world
mc_tile_entities Tile Entities loaded per world
mc_jvm_memory JVM memory usage

Original Bukkit version by sladkoff GitHub - sladkoff/minecraft-prometheus-exporter: A Bukkit plugin which exports minecraft server stats to Prometheus

3 Likes

A new version has been released for PrometheusExporter, it is available for download here.


  • added used memory stat

A new version has been released for PrometheusExporter, it is available for download here.


1.1.1 - Cleanup

  • updated Grafana Template
  • renamed some metrics
    • mc_loaded_chunks_total > mc_loaded_chunks
    • mc_players_online_total > mc_players_online
    • mc_entities_total > mc_entities
    • mc_tile_entities_total > mc_tile_entities
  • got rid of all the Jetty logspam

You can look at a live example here https://www.stonebound.net/monitor/dashboard/db/stoneage

1 Like

A new version has been released for PrometheusExporter, it is available for download here.


fixed relocation and bumped to API7

@Phit - can’t to load your plugin

Errored with

Unexpected exception[NoSuchFileException: /home/ore/files/plugins/phit/PrometheusExporter/spongeprometheusexporter-1.2.0-plugin.jar]

Ore is having issues once again, nothing I can do about that.
You can find working downloads here Releases · Stonebound/PrometheusExporter · GitHub

A new version has been released for PrometheusExporter, it is available for download here.


Prometheus Exporter for Sponge

proper API 7.0.0 release

A new version has been released for PrometheusExporter, it is available for download here.


spam be gone, thought I already pushed this a while ago!
sorry for the spam…

Hi,

I want to use this on my servers but where do I add
{group=“serverX”}
I have no idea where in the JSON to add this

Thanks!