Skip to content

Commit

Permalink
Merge pull request #337 from pouriya/mod_prometheus
Browse files Browse the repository at this point in the history
Prometheus support
  • Loading branch information
badlop committed Jul 13, 2024
2 parents 5ce7c11 + 8737ff0 commit 83a5d06
Show file tree
Hide file tree
Showing 4 changed files with 476 additions and 7 deletions.
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

0 comments on commit 83a5d06

Please sign in to comment.