diff options
Diffstat (limited to 'internal/metrics/metrics.go')
-rw-r--r-- | internal/metrics/metrics.go | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/internal/metrics/metrics.go b/internal/metrics/metrics.go index c46fb8f..b328445 100644 --- a/internal/metrics/metrics.go +++ b/internal/metrics/metrics.go @@ -9,9 +9,10 @@ import ( ) const ( - namespace = "gitlab_shell" - sshdSubsystem = "sshd" - httpSubsystem = "http" + namespace = "gitlab_shell" + sshdSubsystem = "sshd" + httpSubsystem = "http" + gitalySubsystem = "gitaly" httpInFlightRequestsMetricName = "in_flight_requests" httpRequestsTotalMetricName = "requests_total" @@ -20,6 +21,8 @@ const ( sshdConnectionsInFlightName = "in_flight_connections" sshdConnectionDuration = "connection_duration_seconds" sshdHitMaxSessions = "concurrent_limited_sessions_total" + + gitalyConnectionsTotalName = "connections_total" ) var ( @@ -61,6 +64,16 @@ var ( }, ) + GitalyConnectionsTotal = promauto.NewCounterVec( + prometheus.CounterOpts{ + Namespace: namespace, + Subsystem: gitalySubsystem, + Name: gitalyConnectionsTotalName, + Help: "Number of Gitaly connections that have been established", + }, + []string{"status"}, + ) + // The metrics and the buckets size are similar to the ones we have for handlers in Labkit // When the MR: https://gitlab.com/gitlab-org/labkit/-/merge_requests/150 is merged, // these metrics can be refactored out of Gitlab Shell code by using the helper function from Labkit |