logo

pleroma

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

prometheus.md (1683B)


  1. # Prometheus / OpenTelemetry Metrics
  2. Pleroma includes support for exporting metrics via the [prom_ex](https://github.com/akoutmos/prom_ex) library.
  3. The metrics are exposed by a dedicated webserver/port to improve privacy and security.
  4. Config example:
  5. ```
  6. config :pleroma, Pleroma.PromEx,
  7. disabled: false,
  8. manual_metrics_start_delay: :no_delay,
  9. drop_metrics_groups: [],
  10. grafana: [
  11. host: System.get_env("GRAFANA_HOST", "http://localhost:3000"),
  12. auth_token: System.get_env("GRAFANA_TOKEN"),
  13. upload_dashboards_on_start: false,
  14. folder_name: "BEAM",
  15. annotate_app_lifecycle: true
  16. ],
  17. metrics_server: [
  18. port: 4021,
  19. path: "/metrics",
  20. protocol: :http,
  21. pool_size: 5,
  22. cowboy_opts: [],
  23. auth_strategy: :none
  24. ],
  25. datasource: "Prometheus"
  26. ```
  27. PromEx supports the ability to automatically publish dashboards to your Grafana server as well as register Annotations. If you do not wish to configure this capability you must generate the dashboard JSON files and import them directly. You can find the mix commands in the upstream [documentation](https://hexdocs.pm/prom_ex/Mix.Tasks.PromEx.Dashboard.Export.html). You can find the list of modules enabled in Pleroma for which you should generate dashboards for by examining the contents of the `lib/pleroma/prom_ex.ex` module.
  28. ## prometheus.yml
  29. The following is a bare minimum config example to use with [Prometheus](https://prometheus.io) or Prometheus-compatible software like [VictoriaMetrics](https://victoriametrics.com).
  30. ```
  31. global:
  32. scrape_interval: 15s
  33. scrape_configs:
  34. - job_name: 'pleroma'
  35. scheme: http
  36. static_configs:
  37. - targets: ['pleroma.soykaf.com:4021']
  38. ```