diff options
author | Ash McKenzie <amckenzie@gitlab.com> | 2022-04-14 05:47:34 +0000 |
---|---|---|
committer | Ash McKenzie <amckenzie@gitlab.com> | 2022-04-14 05:47:34 +0000 |
commit | 5fe0d17f11eb122d45bad9126c7c0646e196b1c5 (patch) | |
tree | bc89cbdc9ec3ca400305975e83363669fe639e69 /internal/metrics/metrics.go | |
parent | 9abd6d79043f90057ff9a7bf9deecb868e83c46d (diff) | |
parent | cc353a57f3aa8f3f751c175ea596d2baca0b1f19 (diff) | |
download | gitlab-shell-5fe0d17f11eb122d45bad9126c7c0646e196b1c5.tar.gz |
Merge branch 'id-metrics-for-results' into 'main'
Add additional metrics to gitlab-sshd
See merge request gitlab-org/gitlab-shell!593
Diffstat (limited to 'internal/metrics/metrics.go')
-rw-r--r-- | internal/metrics/metrics.go | 56 |
1 files changed, 41 insertions, 15 deletions
diff --git a/internal/metrics/metrics.go b/internal/metrics/metrics.go index b328445..5fa5036 100644 --- a/internal/metrics/metrics.go +++ b/internal/metrics/metrics.go @@ -18,30 +18,42 @@ const ( httpRequestsTotalMetricName = "requests_total" httpRequestDurationSecondsMetricName = "request_duration_seconds" - sshdConnectionsInFlightName = "in_flight_connections" - sshdConnectionDuration = "connection_duration_seconds" - sshdHitMaxSessions = "concurrent_limited_sessions_total" + sshdConnectionsInFlightName = "in_flight_connections" + sshdHitMaxSessionsName = "concurrent_limited_sessions_total" + sshdSessionDurationSecondsName = "session_duration_seconds" + sshdSessionEstablishedDurationSecondsName = "session_established_duration_seconds" + + sliSshdSessionsTotalName = "gitlab_sli:shell_sshd_sessions:total" + sliSshdSessionsErrorsTotalName = "gitlab_sli:shell_sshd_sessions:errors_total" gitalyConnectionsTotalName = "connections_total" ) var ( - SshdConnectionDuration = promauto.NewHistogram( + SshdSessionDuration = promauto.NewHistogram( prometheus.HistogramOpts{ Namespace: namespace, Subsystem: sshdSubsystem, - Name: sshdConnectionDuration, + Name: sshdSessionDurationSecondsName, Help: "A histogram of latencies for connections to gitlab-shell sshd.", Buckets: []float64{ - 0.005, /* 5ms */ - 0.025, /* 25ms */ - 0.1, /* 100ms */ - 0.5, /* 500ms */ - 1.0, /* 1s */ - 10.0, /* 10s */ - 30.0, /* 30s */ - 60.0, /* 1m */ - 300.0, /* 5m */ + 5.0, /* 5s */ + 30.0, /* 30s */ + 60.0, /* 1m */ + }, + }, + ) + + SshdSessionEstablishedDuration = promauto.NewHistogram( + prometheus.HistogramOpts{ + Namespace: namespace, + Subsystem: sshdSubsystem, + Name: sshdSessionEstablishedDurationSecondsName, + Help: "A histogram of latencies until session established to gitlab-shell sshd.", + Buckets: []float64{ + 0.5, /* 5ms */ + 1.0, /* 1s */ + 5.0, /* 5s */ }, }, ) @@ -59,11 +71,25 @@ var ( prometheus.CounterOpts{ Namespace: namespace, Subsystem: sshdSubsystem, - Name: sshdHitMaxSessions, + Name: sshdHitMaxSessionsName, Help: "The number of times the concurrent sessions limit was hit in gitlab-shell sshd.", }, ) + SliSshdSessionsTotal = promauto.NewCounter( + prometheus.CounterOpts{ + Name: sliSshdSessionsTotalName, + Help: "Number of SSH sessions that have been established", + }, + ) + + SliSshdSessionsErrorsTotal = promauto.NewCounter( + prometheus.CounterOpts{ + Name: sliSshdSessionsErrorsTotalName, + Help: "Number of SSH sessions that have failed", + }, + ) + GitalyConnectionsTotal = promauto.NewCounterVec( prometheus.CounterOpts{ Namespace: namespace, |