LOENS2 / pterodactyl_exporter

Python script that extracts metrics from the Pterodactyl API and provides a metrics endpoint for Prometheus
GNU General Public License v3.0
29 stars 11 forks source link
metrics prometheus pterodactyl

Pterodactyl Exporter

Please use the Discussion for Support rather than the Issues.

A python script that exports performance metrics from Pterodactyl Panel 1.x via the Client API, converts the data to the correct format and provides a prometheus target.

This can be used for time series monitoring of Pterodactyl game servers and visualization with Grafana.

Feel free to try this script and submit an issue if needed.

How to install

What you need:

Run as Pterodactyl Server

Run as service

Installed as user "prometheus":

[Service] User=prometheus Restart=on-failure ExecStart=pterodactyl_exporter \ --config-file=/home/prometheus/pterodactyl_exporter/config.yml

[Install] WantedBy=multi-user.target


 - Enable and start the service.

 - Add a job configuration:

 ```yml
 - job_name: 'pterodactyl_exporter'
    static_configs:
      - targets: ['localhost:9531']

Run with Docker

Run manually

Only meant for testing purposes, not recommended for production use!

Troubleshooting

You can view the output with (Time is UTC):

sudo journalctl -u pterodacyl_exporter.service -b --since "2024-12-14 13:45:27"

Post any stacktraces as an Issue.

With special thanks to @grimsi for helping me with docker.

© LOENS2 2023