aboutsummaryrefslogtreecommitdiff
path: root/docs/development/API/prometheus.md
diff options
context:
space:
mode:
authorRoman Chvanikov <chvanikoff@pm.me>2021-01-18 11:56:40 +0300
committerRoman Chvanikov <chvanikoff@pm.me>2021-01-18 11:56:40 +0300
commit2289a1d58777b8ed129e322c3ce4119bc129366c (patch)
tree693af643bfd94af28c29ec519ef8df0f208d7424 /docs/development/API/prometheus.md
parentdbaa15232bfe4c2bc3e2b1a17cfc7503e7036d77 (diff)
parent732cc0ce46e8044909dd5205858c43f75fe3e937 (diff)
downloadpleroma-2289a1d58777b8ed129e322c3ce4119bc129366c.tar.gz
Merge branch 'develop' into refactor/uploads
Diffstat (limited to 'docs/development/API/prometheus.md')
-rw-r--r--docs/development/API/prometheus.md44
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']
+```