You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
1.2 KiB
45 lines
1.2 KiB
6 years ago
|
# Prometheus Metrics
|
||
|
|
||
|
Pleroma includes support for exporting metrics via the [prometheus_ex](https://github.com/deadtrickster/prometheus.ex) library.
|
||
|
|
||
4 years ago
|
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
|
||
|
```
|
||
|
|
||
|
* `enabled` (Pleroma extension) enables the endpoint
|
||
|
* `ip_whitelist` (Pleroma extension) could be used to restrict access only to specified IPs
|
||
|
* `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
|
||
|
|
||
|
|
||
6 years ago
|
## `/api/pleroma/app_metrics`
|
||
4 years ago
|
|
||
6 years ago
|
### Exports Prometheus application metrics
|
||
4 years ago
|
|
||
6 years ago
|
* Method: `GET`
|
||
4 years ago
|
* Authentication: not required by default (see configuration options above)
|
||
6 years ago
|
* Params: none
|
||
4 years ago
|
* Response: text
|
||
6 years ago
|
|
||
|
## Grafana
|
||
4 years ago
|
|
||
6 years ago
|
### Config example
|
||
4 years ago
|
|
||
6 years ago
|
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']
|
||
|
```
|