akkoma/docs/docs/development/API/prometheus.md

34 lines
639 B
Markdown
Raw Normal View History

2019-04-04 17:19:31 +00:00
# Prometheus Metrics
2022-07-04 02:34:54 +00:00
Akkoma includes support for exporting metrics via the [prometheus_ex](https://github.com/deadtrickster/prometheus.ex) library.
2019-04-04 17:19:31 +00:00
Config example:
```
2023-02-18 13:39:22 +00:00
config :pleroma, :instance,
export_prometheus_metrics: true
```
2023-02-18 13:39:22 +00:00
## `/api/v1/akkoma/metrics`
2019-04-04 17:19:31 +00:00
### Exports Prometheus application metrics
2019-04-04 17:19:31 +00:00
* Method: `GET`
2023-02-18 13:39:22 +00:00
* Authentication: required
2019-04-04 17:19:31 +00:00
* Params: none
* Response: text
2019-04-04 17:19:31 +00:00
## Grafana
2019-04-04 17:19:31 +00:00
### Config example
2019-04-04 17:19:31 +00:00
The following is a config example to use with [Grafana](https://grafana.com)
```
- job_name: 'beam'
2023-02-18 13:39:22 +00:00
metrics_path: /api/v1/akkoma/metrics
2019-04-04 17:19:31 +00:00
scheme: https
static_configs:
2022-11-14 00:01:31 +00:00
- targets: ['otp.akkoma.dev']
2019-04-04 17:19:31 +00:00
```