From f8336fa74af82c9c6cfae8be4f4e0d4376a9759c Mon Sep 17 00:00:00 2001 From: Trong Huu Nguyen Date: Fri, 28 Apr 2023 07:58:58 +0200 Subject: [PATCH] feat(metrics): ignore empty hosts for redirect label --- pkg/metrics/metrics.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/metrics/metrics.go b/pkg/metrics/metrics.go index a605cae..207a4e3 100644 --- a/pkg/metrics/metrics.go +++ b/pkg/metrics/metrics.go @@ -161,6 +161,10 @@ func ObserveLogin(amrValue, redirect string) { u.RawQuery = "" u.RawFragment = "" redirect = u.String() + + if u.Host == "" { + redirect = "" + } } Logins.With(prometheus.Labels{