From f793203e043aaa2db38823c84500e82756348ac0 Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Thu, 17 Jul 2025 18:45:43 +0300 Subject: Added session duration metrics with device analytics along with device analytics metrics in the DB to aggregate and DeviceID abuse prevention --- internal/server/metrics/metrics.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'internal/server/metrics/metrics.go') diff --git a/internal/server/metrics/metrics.go b/internal/server/metrics/metrics.go index 1ce907c..d465b6c 100644 --- a/internal/server/metrics/metrics.go +++ b/internal/server/metrics/metrics.go @@ -55,3 +55,10 @@ var UsersActive = promauto.NewGauge(prometheus.GaugeOpts{ Name: "users_active_total", Help: "The total number of active users", }) + +var SessionDuration = promauto.NewHistogramVec(prometheus.HistogramOpts{ + Namespace: namespace, + Name: "session_duration_seconds", + Help: "The duration in seconds of an authenticated session", + NativeHistogramBucketFactor: 1.00271, +}, []string{"os", "arch", "term", "colorterm"}) -- cgit v1.3.1