logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git

prometheus.md (1276B)


  1. # Prometheus Metrics
  2. Pleroma includes support for exporting metrics via the [prometheus_ex](https://github.com/deadtrickster/prometheus.ex) library.
  3. Config example:
  4. ```
  5. config :prometheus, Pleroma.Web.Endpoint.MetricsExporter,
  6. enabled: true,
  7. auth: {:basic, "myusername", "mypassword"},
  8. ip_whitelist: ["127.0.0.1"],
  9. path: "/api/pleroma/app_metrics",
  10. format: :text
  11. ```
  12. * `enabled` (Pleroma extension) enables the endpoint
  13. * `ip_whitelist` (Pleroma extension) could be used to restrict access only to specified IPs
  14. * `auth` sets the authentication (`false` for no auth; configurable to HTTP Basic Auth, see [prometheus-plugs](https://github.com/deadtrickster/prometheus-plugs#exporting) documentation)
  15. * `format` sets the output format (`:text` or `:protobuf`)
  16. * `path` sets the path to app metrics page
  17. ## `/api/pleroma/app_metrics`
  18. ### Exports Prometheus application metrics
  19. * Method: `GET`
  20. * Authentication: not required by default (see configuration options above)
  21. * Params: none
  22. * Response: text
  23. ## Grafana
  24. ### Config example
  25. The following is a config example to use with [Grafana](https://grafana.com)
  26. ```
  27. - job_name: 'beam'
  28. metrics_path: /api/pleroma/app_metrics
  29. scheme: https
  30. static_configs:
  31. - targets: ['pleroma.soykaf.com']
  32. ```