Skip to content

Commit 6eb1a95

Browse files
committed
sftpConnectionsTotal
1 parent 5ac27b7 commit 6eb1a95

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

agent/agentssh/agentssh.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ func (s *Server) startPTYSession(session ptySession, m sessionMetricsObject, cmd
408408
}
409409

410410
func (s *Server) sftpHandler(session ssh.Session) {
411-
s.metrics.sftpHandler.Add(1)
411+
s.metrics.sftpConnectionsTotal.Add(1)
412412

413413
ctx := session.Context()
414414

agent/agentssh/metrics.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ type sshServerMetrics struct {
1010
failedConnectionsTotal prometheus.Counter
1111

1212
// SFTP
13-
sftpHandler prometheus.Counter
14-
sftpServerError prometheus.Counter
13+
sftpConnectionsTotal prometheus.Counter
14+
sftpServerError prometheus.Counter
1515

1616
// X11
1717
x11SocketDirError prometheus.Counter
@@ -52,10 +52,10 @@ func newSSHServerMetrics(registerer prometheus.Registerer) *sshServerMetrics {
5252
})
5353
registerer.MustRegister(failedConnectionsTotal)
5454

55-
sftpHandler := prometheus.NewCounter(prometheus.CounterOpts{
56-
Namespace: "agent", Subsystem: "ssh_server", Name: "sftp_handler",
55+
sftpConnectionsTotal := prometheus.NewCounter(prometheus.CounterOpts{
56+
Namespace: "agent", Subsystem: "ssh_server", Name: "sftp_connections_total",
5757
})
58-
registerer.MustRegister(sftpHandler)
58+
registerer.MustRegister(sftpConnectionsTotal)
5959

6060
sftpServerError := prometheus.NewCounter(prometheus.CounterOpts{
6161
Namespace: "agent", Subsystem: "ssh_server", Name: "sftp_server_error",
@@ -81,7 +81,7 @@ func newSSHServerMetrics(registerer prometheus.Registerer) *sshServerMetrics {
8181

8282
return &sshServerMetrics{
8383
failedConnectionsTotal: failedConnectionsTotal,
84-
sftpHandler: sftpHandler,
84+
sftpConnectionsTotal: sftpConnectionsTotal,
8585
sftpServerError: sftpServerError,
8686
x11HostnameError: x11HostnameError,
8787
x11SocketDirError: x11SocketDirError,

0 commit comments

Comments
 (0)