2019-04-04 11:19:31 -06:00
# Prometheus Metrics
2022-07-03 20:34:54 -06:00
Akkoma includes support for exporting metrics via the [prometheus_ex ](https://github.com/deadtrickster/prometheus.ex ) library.
2019-04-04 11:19:31 -06:00
2020-10-18 12:22:21 -06:00
Config example:
```
config :prometheus, Pleroma.Web.Endpoint.MetricsExporter,
enabled: true,
auth: {:basic, "myusername", "mypassword"},
ip_whitelist: ["127.0.0.1"],
path: "/api/pleroma/app_metrics",
format: :text
```
2022-07-03 20:34:54 -06:00
* `enabled` (Akkoma extension) enables the endpoint
* `ip_whitelist` (Akkoma extension) could be used to restrict access only to specified IPs
2020-10-18 12:22:21 -06:00
* `auth` sets the authentication (`false` for no auth; configurable to HTTP Basic Auth, see [prometheus-plugs ](https://github.com/deadtrickster/prometheus-plugs#exporting ) documentation)
* `format` sets the output format (`:text` or `:protobuf` )
* `path` sets the path to app metrics page
2019-04-04 11:19:31 -06:00
## `/api/pleroma/app_metrics`
2020-10-18 12:22:21 -06:00
2019-04-04 11:19:31 -06:00
### Exports Prometheus application metrics
2020-10-18 12:22:21 -06:00
2019-04-04 11:19:31 -06:00
* Method: `GET`
2020-10-18 12:22:21 -06:00
* Authentication: not required by default (see configuration options above)
2019-04-04 11:19:31 -06:00
* Params: none
2020-10-18 12:22:21 -06:00
* Response: text
2019-04-04 11:19:31 -06:00
## Grafana
2020-10-18 12:22:21 -06:00
2019-04-04 11:19:31 -06:00
### Config example
2020-10-18 12:22:21 -06:00
2019-04-04 11:19:31 -06:00
The following is a config example to use with [Grafana ](https://grafana.com )
```
- job_name: 'beam'
metrics_path: /api/pleroma/app_metrics
scheme: https
static_configs:
- targets: ['pleroma.soykaf.com']
```