Skip to content

Commit 9620452

Browse files
committed
sftpServerErrors
1 parent e3d7493 commit 9620452

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

agent/agentssh/agentssh.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ func (s *Server) sftpHandler(session ssh.Session) {
447447
return
448448
}
449449
s.logger.Warn(ctx, "sftp server closed with error", slog.Error(err))
450-
s.metrics.sftpServerError.Add(1)
450+
s.metrics.sftpServerErrors.Add(1)
451451
_ = session.Exit(1)
452452
}
453453

agent/agentssh/metrics.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ type sshServerMetrics struct {
1111

1212
// SFTP
1313
sftpConnectionsTotal prometheus.Counter
14-
sftpServerError prometheus.Counter
14+
sftpServerErrors prometheus.Counter
1515

1616
// X11
1717
x11SocketDirError prometheus.Counter
@@ -56,10 +56,10 @@ func newSSHServerMetrics(registerer prometheus.Registerer) *sshServerMetrics {
5656
})
5757
registerer.MustRegister(sftpConnectionsTotal)
5858

59-
sftpServerError := prometheus.NewCounter(prometheus.CounterOpts{
60-
Namespace: "agent", Subsystem: "ssh_server", Name: "sftp_server_error",
59+
sftpServerErrors := prometheus.NewCounter(prometheus.CounterOpts{
60+
Namespace: "agent", Subsystem: "ssh_server", Name: "sftp_server_errors_total",
6161
})
62-
registerer.MustRegister(sftpServerError)
62+
registerer.MustRegister(sftpServerErrors)
6363

6464
x11HostnameError := prometheus.NewCounter(prometheus.CounterOpts{
6565
Namespace: "agent", Subsystem: "ssh_server", Name: "x11_hostname_error",
@@ -81,7 +81,7 @@ func newSSHServerMetrics(registerer prometheus.Registerer) *sshServerMetrics {
8181
return &sshServerMetrics{
8282
failedConnectionsTotal: failedConnectionsTotal,
8383
sftpConnectionsTotal: sftpConnectionsTotal,
84-
sftpServerError: sftpServerError,
84+
sftpServerErrors: sftpServerErrors,
8585
x11HostnameError: x11HostnameError,
8686
x11SocketDirError: x11SocketDirError,
8787
x11XauthorityError: x11XauthorityError,

0 commit comments

Comments
 (0)