From b7ef07679839980a24b8cab0ec36e07eb00dac4a Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Sat, 4 Sep 2021 15:56:57 +0200 Subject: [PATCH] outposts: add expected outpost replica count to metrics Signed-off-by: Jens Langhammer --- authentik/outposts/channels.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/authentik/outposts/channels.py b/authentik/outposts/channels.py index 718640703..74ce0a05a 100644 --- a/authentik/outposts/channels.py +++ b/authentik/outposts/channels.py @@ -15,7 +15,7 @@ from authentik.core.channels import AuthJsonConsumer from authentik.outposts.models import OUTPOST_HELLO_INTERVAL, Outpost, OutpostState GAUGE_OUTPOSTS_CONNECTED = Gauge( - "authentik_outposts_connected", "Currently connected outposts", ["outpost", "uid"] + "authentik_outposts_connected", "Currently connected outposts", ["outpost", "uid", "expected"] ) GAUGE_OUTPOSTS_LAST_UPDATE = Gauge( "authentik_outposts_last_update", @@ -76,6 +76,7 @@ class OutpostConsumer(AuthJsonConsumer): GAUGE_OUTPOSTS_CONNECTED.labels( outpost=self.outpost.name, uid=self.last_uid, + expected=self.outpost.config.kubernetes_replicas, ).dec() LOGGER.debug( "removed outpost instance from cache", @@ -100,6 +101,7 @@ class OutpostConsumer(AuthJsonConsumer): GAUGE_OUTPOSTS_CONNECTED.labels( outpost=self.outpost.name, uid=self.last_uid, + expected=self.outpost.config.kubernetes_replicas, ).inc() LOGGER.debug( "added outpost instace to cache",