From 57c867b21338eca09ce6ce4fa5f23dd064c1abb0 Mon Sep 17 00:00:00 2001 From: Viktor Erlingsson Date: Fri, 11 Oct 2024 15:52:07 +0200 Subject: [PATCH 1/2] add clustering_max_lag to /metrics --- src/lavinmq/http/controller/prometheus.cr | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lavinmq/http/controller/prometheus.cr b/src/lavinmq/http/controller/prometheus.cr index f739d41d77..18caecc235 100644 --- a/src/lavinmq/http/controller/prometheus.cr +++ b/src/lavinmq/http/controller/prometheus.cr @@ -264,6 +264,10 @@ module LavinMQ value: @amqp_server.followers.size, type: "gauge", help: "Amount of follower nodes connected"}) + writer.write({name: "clustering_max_lag", + value: Config.instance.clustering_max_lag, + type: "gauge", + help: "Max unsynced replicated messages"}) @amqp_server.followers.each do |f| writer.write({name: "follower_lag", labels: {id: f.id.to_s(36)}, From de299535d3b54326fbb7224c55650df1baf214b7 Mon Sep 17 00:00:00 2001 From: Viktor Erlingsson Date: Fri, 11 Oct 2024 23:01:03 +0200 Subject: [PATCH 2/2] Update description Co-authored-by: Patrik Ragnarsson --- src/lavinmq/http/controller/prometheus.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lavinmq/http/controller/prometheus.cr b/src/lavinmq/http/controller/prometheus.cr index 18caecc235..28fc5c6878 100644 --- a/src/lavinmq/http/controller/prometheus.cr +++ b/src/lavinmq/http/controller/prometheus.cr @@ -267,7 +267,7 @@ module LavinMQ writer.write({name: "clustering_max_lag", value: Config.instance.clustering_max_lag, type: "gauge", - help: "Max unsynced replicated messages"}) + help: "Maximum allowed unsynced replicated messages"}) @amqp_server.followers.each do |f| writer.write({name: "follower_lag", labels: {id: f.id.to_s(36)},