re-add workers count metric

Signed-off-by: Marc 'risson' Schmitt <marc.schmitt@risson.space>
This commit is contained in:
Marc 'risson' Schmitt
2025-06-30 06:38:31 +02:00
parent 06191d6cfc
commit 6b3fbb0abf

View File

@ -10,11 +10,16 @@ from authentik import get_full_version
from authentik.root.monitoring import monitoring_set
from authentik.tasks.models import WorkerStatus
GAUGE_WORKERS = Gauge(
OLD_GAUGE_WORKERS = Gauge(
"authentik_admin_workers",
"Currently connected workers, their versions and if they are the same version as authentik",
["version", "version_matched"],
)
GAUGE_WORKERS = Gauge(
"authentik_tasks_workers",
"Currently connected workers, their versions and if they are the same version as authentik",
["version", "version_matched"],
)
_version = parse(get_full_version())
@ -36,4 +41,5 @@ def monitoring_set_workers(sender, **kwargs):
)
worker_version_count[status.version]["count"] += 1
for version, stats in worker_version_count.items():
OLD_GAUGE_WORKERS.labels(version, stats["matching"]).set(stats["count"])
GAUGE_WORKERS.labels(version, stats["matching"]).set(stats["count"])