diff options
author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2021-01-13 22:11:16 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2021-01-13 22:11:16 +0300 |
commit | e3508988283a0902a7e330995a0c224811956bce (patch) | |
tree | edd0a0eb6301980aef5fe02653610929594607cf /docs/development/API/prometheus.md | |
parent | 3e4d84729a4ca8d9779d439a9aa2c8c23b3acd1d (diff) | |
parent | f917285b72dbc770be40478e1a55973f29d5db7d (diff) | |
download | pleroma-e3508988283a0902a7e330995a0c224811956bce.tar.gz pleroma-e3508988283a0902a7e330995a0c224811956bce.zip |
Merge remote-tracking branch 'remotes/origin/develop' into feature/object-hashtags-rework
Diffstat (limited to 'docs/development/API/prometheus.md')
-rw-r--r-- | docs/development/API/prometheus.md | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/docs/development/API/prometheus.md b/docs/development/API/prometheus.md new file mode 100644 index 000000000..a5158d905 --- /dev/null +++ b/docs/development/API/prometheus.md @@ -0,0 +1,44 @@ +# Prometheus Metrics + +Pleroma includes support for exporting metrics via the [prometheus_ex](https://github.com/deadtrickster/prometheus.ex) library. + +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 + + +## `/api/pleroma/app_metrics` + +### Exports Prometheus application metrics + +* Method: `GET` +* Authentication: not required by default (see configuration options above) +* Params: none +* Response: text + +## Grafana + +### Config example + +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'] +``` |