rebelcore/minecraft-exporter

By rebelcore

Updated about 1 year ago

rebelcore/minecraft-exporter

Image
0

435

rebelcore/minecraft-exporter repository overview

Minecraft exporter

Test & Build Current Release Docker Pulls Go Report Card

Prometheus exporter for Minecraft metrics exposed in Go with pluggable metric collectors.

Installation and Usage

If you are new to Prometheus and minecraft_exporter there is a simple step-by-step guide.

The minecraft_exporter listens on HTTP port 9940 by default. See the --help output for more options.

Ansible

Coming Soon!

Docker

The minecraft_exporter is designed to monitor your Minecraft players real time locations.

For situations where containerized deployment is needed, you will need to set the RCON address flag to use the docker container hostname.

docker run -d \
  -p 9940:9940 \
  rebelcore/minecraft-exporter:latest \
  --rcon.address=minecraft:25575

For Docker compose, similar flag changes are needed.

---
services:
  minecraft_exporter:
    image: rebelcore/minecraft-exporter:latest
    container_name: minecraft_exporter
    command:
      - '--rcon.address=minecraft:25575'
    ports:
      - 9940:9940
    restart: unless-stopped

Collectors

There is varying support for collectors. The tables below list all existing collectors.

Collectors are enabled by providing a --collector.<name> flag. Collectors that are enabled by default can be disabled by providing a --no-collector.<name> flag. To enable only some specific collector(s), use --collector.disable-defaults --collector.<name> ....

Enabled by default
NameDescription
playerExposes player username, dimension, XP, and coordinates in real time.
systemExposes if the Minecraft server is online or not.
Filtering enabled collectors

The minecraft_exporter will expose all metrics from enabled collectors by default. This is the recommended way to collect metrics to avoid errors.

For advanced use the minecraft_exporter can be passed an optional list of collectors to filter metrics. The collect[] parameter may be used multiple times. In Prometheus configuration you can use this syntax under the scrape config.

  params:
    collect[]:
      - foo
      - bar

This can be useful for having different Prometheus servers collect specific metrics from nodes.

Development building and running

Prerequisites:

Building:

git clone https://github.com/rebelcore/minecraft_exporter.git
cd minecraft_exporter
make build
./minecraft_exporter <flags>

To see all available configuration flags:

./minecraft_exporter --help

Running tests

make test

TLS endpoint

EXPERIMENTAL

The exporter supports TLS via a new web configuration file.

./minecraft_exporter --web.config.file=web-config.yml

See the exporter-toolkit web-configuration for more details.

Tag summary

Content type

Image

Digest

sha256:5fef92e80

Size

12.7 MB

Last updated

about 1 year ago

docker pull rebelcore/minecraft-exporter:v1.0.3