diff options
author | rinpatch <rinpatch@sdf.org> | 2021-01-10 08:25:36 +0000 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2021-01-10 08:25:36 +0000 |
commit | ad5338a79c32feaefb77ae3b62ab8e2dbcdd2d5e (patch) | |
tree | c56758cdaa95ce053e04952497386542e1b28531 /docs/development/API/prometheus.md | |
parent | 5822338f3a42852c18a323c35041b14b29661de6 (diff) | |
parent | 6284e8f4b2e9b737d1ed256e89f2ac3ba673d6f8 (diff) | |
download | pleroma-ad5338a79c32feaefb77ae3b62ab8e2dbcdd2d5e.tar.gz pleroma-ad5338a79c32feaefb77ae3b62ab8e2dbcdd2d5e.zip |
Merge branch 'add_some_information_about_setting_up_a_development_environment' into 'develop'
Add some information about setting up a development environment
Closes #1904
See merge request pleroma/pleroma!3207
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'] +``` |