aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgenofire <geno+dev@fireorbit.de>2020-06-26 08:25:10 +0200
committergenofire <geno+dev@fireorbit.de>2020-06-26 08:25:10 +0200
commit1256ea7de8a093f51b116f2802871480cd646ae8 (patch)
treeccda4c083ca26f943fbbc3be110f39957213517a
parent76b6be03ab500f82beca4b072a5c50bbed07f294 (diff)
add new metrics to prometheus
-rwxr-xr-xprometheus.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/prometheus.py b/prometheus.py
index da0d24c..9af4de3 100755
--- a/prometheus.py
+++ b/prometheus.py
@@ -57,6 +57,10 @@ class Prometheus:
Gauge('ejabberd_node_s2s_in', 'count of incoming server-to-server connection', registry=registry).set(self._metrics.get_s2s_in())
Gauge('ejabberd_node_s2s_out', 'count of outgoing server-to-server connection', registry=registry).set(self._metrics.get_s2s_out())
+ nodename = self._metrics.nodename
+ Gauge('ejabberd_node_uptime', 'uptime of ejabberd service', ["node"], registry=registry).labels(nodename).set(self._metrics.get_uptime())
+ Gauge('ejabberd_node_proccess', 'count of pejabber proccess', ["node"], registry=registry).labels(nodename).set(self._metrics.get_processes())
+
labelnames_vhost = ["vhost"]
registered_vhosts = Gauge('ejabberd_registered_vhosts', 'count of user per vhost', labelnames_vhost, registry=registry)