65fbbb2491a4d4706bdc5282a540199280175e7e
[akkoma] / docs / docs / administration / monitoring.md
1 # Monitoring Akkoma
2
3 If you run akkoma, you may be inclined to collect metrics to ensure your instance is running smoothly,
4 and that there's nothing quietly failing in the background.
5
6 To facilitate this, akkoma exposes prometheus metrics to be scraped.
7
8 ## Prometheus
9
10 To scrape prometheus metrics, we need an oauth2 token with the `admin:metrics` scope.
11
12 consider using [constanze](https://akkoma.dev/AkkomaGang/constanze) to make this easier -
13
14 ```bash
15 constanze token --client-app --scopes "admin:metrics" --client-name "Prometheus"
16 ```
17
18 or see `scripts/create_metrics_app.sh` in the source tree for the process to get this token.
19
20 Once you have your token of the form `Bearer $ACCESS_TOKEN`, you can use that in your prometheus config:
21
22 ```yaml
23 - job_name: akkoma
24 scheme: https
25 authorization:
26 credentials: $ACCESS_TOKEN # this should have the bearer prefix removed
27 metrics_path: /api/v1/akkoma/metrics
28 static_configs:
29 - targets:
30 - example.com
31 ```