Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prometheus support #337

Merged
merged 5 commits into from
Jul 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 29 additions & 6 deletions mod_prometheus/conf/mod_prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,46 @@ modules:
- hook: user_send_packet
type: histogram
help: "Handling of sent messages duration in millisecond"
stanza_label: true
host_label: true
labels:
- host
- stanza
# Histogram for all modules of a hook:
- hook: user_receive_packet
type: histogram
help: "Handling of received messages duration in millisecond"
labels:
- host
- stanza
- module
# Counter for a hook:
- hook: user_send_packet
- hook: sm_register_connection_hook
type: counter
labels:
- host
- stanza
# Counter for all modules of a hook:
- hook: sm_remove_connection_hook
type: counter
help: "Number of sent messages"
# Histograms only for some callbacks of a hook:
labels:
- host
- stanza
- module
help: "Number of closed c2s sessions"
# Histogram for some modules (callbacks) of a hook:
- hook: user_send_packet
type: histogram
host_label: true
labels:
- host
collect:
- module: mod_carboncopy
function: user_send_packet
help: "Handling of carbon copied messages in millisecond"
- module: mod_mam
function: user_send_packet
help: "Handling of MAM messages in millisecond"
labels:
# It also inherits above `host` label
- stanza
buckets:
- 10
- 100
Expand Down
2 changes: 2 additions & 0 deletions mod_prometheus/example/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ version: '3.7'
services:

prometheus:
network_mode: "host"
image: docker.io/prom/prometheus
container_name: prometheus
ports:
Expand All @@ -11,6 +12,7 @@ services:
- ./prometheus.yml:/etc/prometheus/prometheus.yml

grafana:
network_mode: "host"
image: docker.io/grafana/grafana-enterprise
container_name: grafana
ports:
Expand Down
2 changes: 1 addition & 1 deletion mod_prometheus/example/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ scrape_configs:
- targets: ["localhost:9090"]
- job_name: "ejabberd"
static_configs:
- targets: ["host.docker.internal:5289"]
- targets: ["localhost:5289"]
Loading