My Docker-based setup for monitoring a Mastodon instance with Prometheus and Grafana
Mastodon can optionally send metrics to a StatsD endpoint. We can use statsd-exporter to receive the metrics and map them to Prometheus metrics.
The setup consists of the following services:
- statsd-exporter: Receives StatsD metrics from the Mastodon processes and transforms them to Prometheus metrics
- cAdvisor: Container metrics
- Prometheus: scrapes metrics from the above services
Mastodon collects the StatsD metrics listed here. See statsd-exporter/statsd_mapping.yml
for the rules that transforms these metrics.
The dashboard I created based on the data is available at grafana/dashboard.json
if you want to import it.