luc122c / mastodon-metrics

A docker compose project which launches a Grafana/Prometheus stack to monitor a Mastodon instance.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dashboard for monitoring a Mastodon instance

Screenshot of the dashboard

This project was inspired by this blog post by IPngNetworks and Mastodon Setup with Docker Compose by raeffs. In his blog, Pim discusses how he uses Prometheus and Grafana to monitor his Mastodon instance. Everything used is FOSS and available as a container, so I was keen to get it all working in a docker compose stack.

Setup

  1. Clone the repository
git clone https://github.com/luc122c/mastodon-metrics.git
  1. Create a .env file and set up your credentials
ADMIN_USER='admin'
ADMIN_PASSWORD='pleasechangeme'
ALLOW_SIGN_UP=false
  1. Create a volume for Grafana with the command docker volume create grafana-data
  2. Run docker compose up and wait for it all to load
  3. Visit localhost:3000 and login. You should see the 'Mastodon Stats' dashboard available.
  4. Configure Mastodon to log StatsD events to your server with the following environment variable. If Mastodon is running on a separate machine, replace localhost with the IP address of that machine.
STATSD_ADDR='localhost:9125'
  1. Restart Mastodon so that the changes take effect. Data should start to flow into the dashboard.

Configuration

I've commented out some ports that don't need to be exposed for it to work. You can open 9102 on exporter to see the raw data and 9090 on prometheus to see the the Prometheus output.

One other thing I've changed from IPngNetworks' config is the UID of the datasource. The existing value wasn't working so it is now sausage.

References and Thanks

Below are the links to the software, configuration files and articles that make this work.

References

Software

Configuration files

About

A docker compose project which launches a Grafana/Prometheus stack to monitor a Mastodon instance.

License:The Unlicense