fix markdown link
[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 See: [export\_prometheus\_metrics](../../configuration/cheatsheet#instance)
11
12 To scrape prometheus metrics, we need an oauth2 token with the `admin:metrics` scope.
13
14 consider using [constanze](https://akkoma.dev/AkkomaGang/constanze) to make this easier -
15
16 ```bash
17 constanze token --client-app --scopes "admin:metrics" --client-name "Prometheus"
18 ```
19
20 or see `scripts/create_metrics_app.sh` in the source tree for the process to get this token.
21
22 Once you have your token of the form `Bearer $ACCESS_TOKEN`, you can use that in your prometheus config:
23
24 ```yaml
25 - job_name: akkoma
26 scheme: https
27 authorization:
28 credentials: $ACCESS_TOKEN # this should have the bearer prefix removed
29 metrics_path: /api/v1/akkoma/metrics
30 static_configs:
31 - targets:
32 - example.com
33 ```