Server Metrics using Prometheus

From Minetest Wiki
Revision as of 01:53, 31 August 2022 by Buddi (talk | contribs) (→‎Configure prometheus)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Prometheus is an "open-source monitoring system with a dimensional data model, flexible query language, efficient time series database and modern alerting approach".

Minetest has built-in support for prometheus, allowing you to see metrics about your server - such as player count and performance information.

Here are some examples of Grafana dashboards created using Prometheus:

- - (note: this contains heavy mondifications)

Using Prometheus in Minetest

Get or build the prometheus-cpp library

You may be able to find prometheus-cpp in your distro's package manager. Otherwise, you'll need to build it and make it available to Minetest.

Here's how you do that on Linux:

cd /tmp
git clone --recursive
mkdir prometheus-cpp/build
cd prometheus-cpp/build
make -j$(nproc)
sudo make install

Build Minetest

Now, you need build minetest with Prometheus enabled

make -j$(nproc)

Configure prometheus

Prometheus will make HTTP requests to Minetest's prometheus-cpp library to get the metrics.

You can set the prometheus listen address by assigning an IP:PORT in the minetest.conf:

prometheus_listener_address =


You can link up Prometheus to Grafana to make nice web graphs. For example:

To do: example layouts