diff options
author | feld <feld@feld.me> | 2020-10-27 17:47:56 +0000 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2020-11-05 16:22:35 +0300 |
commit | 86b4149a1350b23a122f3ea8e2ef79ab3e8785e1 (patch) | |
tree | 0595c4de429fe5a37c9004dab8895c45d2ff97fd /docs | |
parent | 5f27a39152cfee4746313ee8c63fb5f600fdb1a2 (diff) | |
download | pleroma-86b4149a1350b23a122f3ea8e2ef79ab3e8785e1.tar.gz |
Merge branch '1668-prometheus-access-restrictions' into 'develop'
[#1668] App metrics endpoint (Prometheus) access restrictions
Closes #1668
See merge request pleroma/pleroma!3093
Diffstat (limited to 'docs')
-rw-r--r-- | docs/API/prometheus.md | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/docs/API/prometheus.md b/docs/API/prometheus.md index 19c564e3c..a5158d905 100644 --- a/docs/API/prometheus.md +++ b/docs/API/prometheus.md @@ -2,15 +2,37 @@ 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 +* Authentication: not required by default (see configuration options above) * Params: none -* Response: JSON +* Response: text ## Grafana + ### Config example + The following is a config example to use with [Grafana](https://grafana.com) ``` |