- Requires: ejabberd 24.07 or higher, and Erlang/OTP 26 or higher
- Author: Pouriya Jahanbakhsh
This module provides a web page with metrics suitable for Prometheus, using the prometheus erlang library.
The configurable options are:
-
mnesia: true | false
Enable mnesia metrics or not. Default:
false
-
vm: [metric: true | false, ...]
Enable some Erlang Virtual Machine metrics. Available ones are:
memory
,system_info
,statistics
,distribution
,microstate_accounting
. For details please consult prometheus.erl collectors. Default:[]
-
hooks: [Hook]
List of hooks to investigate. Default is an empty list:
[]
Each Hook is:
hook: atom()
: the name of the hooktype: counter | histogram
help: "Explanation"
stanza_label: true | false
host_label: true | false
collect: all | [Callback]
where each Callback is:module: atom()
function: atom()
help: "Explanation"
buckets: [integer()]
-
Start ejabberd
-
Download dependencies, compile and install this module:
ejabberdctl module_install mod_prometheus
-
Check ejabberd provides metrics in the URL: http://localhost:5289/metrics/
Start Prometheus and Grafana, for example using Podman or Docker:
cd example
podman-compose up
# or
# docker-compose up
-
Open in web browser http://localhost:9090/
-
Enter example query:
erlang_mnesia_tablewise_size{table="muc_online_room"}
-
Open in web browser http://localhost:3000/
-
Login with username
admin
and passwordadmin
-
Add your first data source:
- Add data source:
Prometheus
- Connection URL:
http://localhost:9090
- Click
Save & test
- Add data source:
-
Create your first dashboard
- Import dashboard
- Upload dashboard JSON file: you can try
ejabberd-dash.json
- prometheus: select the data source you created previously
- Click
Import