1
+ // Package metrics provides Prometheus metrics for monitoring gitlab-shell components.
1
2
package metrics
2
3
3
4
import (
@@ -34,6 +35,7 @@ const (
34
35
)
35
36
36
37
var (
38
+ // SshdSessionDuration is a histogram of latencies for connections to gitlab-shell sshd.
37
39
SshdSessionDuration = promauto .NewHistogram (
38
40
prometheus.HistogramOpts {
39
41
Namespace : namespace ,
48
50
},
49
51
)
50
52
53
+ // SshdSessionEstablishedDuration is a histogram of latencies until session established to gitlab-shell sshd.
51
54
SshdSessionEstablishedDuration = promauto .NewHistogram (
52
55
prometheus.HistogramOpts {
53
56
Namespace : namespace ,
62
65
},
63
66
)
64
67
68
+ // SshdConnectionsInFlight is a gauge of connections currently being served by gitlab-shell sshd.
65
69
SshdConnectionsInFlight = promauto .NewGauge (
66
70
prometheus.GaugeOpts {
67
71
Namespace : namespace ,
71
75
},
72
76
)
73
77
78
+ // SshdHitMaxSessions is the number of times the concurrent sessions limit was hit in gitlab-shell sshd.
74
79
SshdHitMaxSessions = promauto .NewCounter (
75
80
prometheus.CounterOpts {
76
81
Namespace : namespace ,
@@ -80,20 +85,23 @@ var (
80
85
},
81
86
)
82
87
88
+ // SliSshdSessionsTotal is the number of SSH sessions that have been established.
83
89
SliSshdSessionsTotal = promauto .NewCounter (
84
90
prometheus.CounterOpts {
85
91
Name : sliSshdSessionsTotalName ,
86
92
Help : "Number of SSH sessions that have been established" ,
87
93
},
88
94
)
89
95
96
+ // SliSshdSessionsErrorsTotal is the number of SSH sessions that have failed.
90
97
SliSshdSessionsErrorsTotal = promauto .NewCounter (
91
98
prometheus.CounterOpts {
92
99
Name : sliSshdSessionsErrorsTotalName ,
93
100
Help : "Number of SSH sessions that have failed" ,
94
101
},
95
102
)
96
103
104
+ // GitalyConnectionsTotal is a counter for the number of Gitaly connections that have been established,
97
105
GitalyConnectionsTotal = promauto .NewCounterVec (
98
106
prometheus.CounterOpts {
99
107
Namespace : namespace ,
@@ -147,13 +155,15 @@ var (
147
155
},
148
156
)
149
157
158
+ // LfsHTTPConnectionsTotal is the number of LFS over HTTP connections that have been established.
150
159
LfsHTTPConnectionsTotal = promauto .NewCounter (
151
160
prometheus.CounterOpts {
152
161
Name : lfsHTTPConnectionsTotalName ,
153
162
Help : "Number of LFS over HTTP connections that have been established" ,
154
163
},
155
164
)
156
165
166
+ // LfsSSHConnectionsTotal is the number of LFS over SSH connections that have been established.
157
167
LfsSSHConnectionsTotal = promauto .NewCounter (
158
168
prometheus.CounterOpts {
159
169
Name : lfsSSHConnectionsTotalName ,
@@ -162,6 +172,7 @@ var (
162
172
)
163
173
)
164
174
175
+ // NewRoundTripper wraps an http.RoundTripper to instrument it with Prometheus metrics.
165
176
func NewRoundTripper (next http.RoundTripper ) promhttp.RoundTripperFunc {
166
177
rt := next
167
178
0 commit comments