summaryrefslogtreecommitdiff
path: root/internal/server/metrics
diff options
context:
space:
mode:
authorKyren223 <Kyren223@proton.me>2025-07-17 18:45:43 +0300
committerKyren223 <Kyren223@proton.me>2025-07-19 18:32:12 +0300
commitf793203e043aaa2db38823c84500e82756348ac0 (patch)
tree88a8a7b78069427f11acb0f2040e9f1d391fab55 /internal/server/metrics
parentaaea258a21226a893025a65222e244c6b3f4454c (diff)
Added session duration metrics with device analytics along with device
analytics metrics in the DB to aggregate and DeviceID abuse prevention
Diffstat (limited to 'internal/server/metrics')
-rw-r--r--internal/server/metrics/metrics.go7
1 files changed, 7 insertions, 0 deletions
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"})