aboutsummaryrefslogtreecommitdiff
path: root/docs/development/API/prometheus.md
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2021-03-02 19:54:30 +0000
committerlain <lain@soykaf.club>2021-03-02 19:54:30 +0000
commitb221d77a6da07c684bdbc63ddf4500e0d7ffeae8 (patch)
tree0015c7c3ea57f7340fbf80fd230a5f5e1c548148 /docs/development/API/prometheus.md
parentc2186a62d54043ea9638d33f80c7576aba9783e8 (diff)
parent0a589c887bd4215e7d443a34c194fd0a3bde8f72 (diff)
downloadpleroma-b221d77a6da07c684bdbc63ddf4500e0d7ffeae8.tar.gz
Merge branch 'release/2.3.0' into 'stable'
Release/2.3.0 See merge request pleroma/pleroma!3354
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']
+```