@@ -7,12 +7,7 @@ import (
7
7
)
8
8
9
9
type sshServerMetrics struct {
10
- // SSH callbacks
11
- connectionFailedCallback prometheus.Counter
12
- localPortForwardingCallback prometheus.Counter
13
- ptyCallback prometheus.Counter
14
- reversePortForwardingCallback prometheus.Counter
15
- x11Callback prometheus.Counter
10
+ connectionFailedCallback prometheus.Counter
16
11
17
12
// SFTP
18
13
sftpHandler prometheus.Counter
@@ -57,26 +52,6 @@ func newSSHServerMetrics(registerer prometheus.Registerer) *sshServerMetrics {
57
52
})
58
53
registerer .MustRegister (connectionFailedCallback )
59
54
60
- localPortForwardingCallback := prometheus .NewCounter (prometheus.CounterOpts {
61
- Namespace : "agent" , Subsystem : "ssh_server" , Name : "local_port_forwarding_callback" ,
62
- })
63
- registerer .MustRegister (localPortForwardingCallback )
64
-
65
- ptyCallback := prometheus .NewCounter (prometheus.CounterOpts {
66
- Namespace : "agent" , Subsystem : "ssh_server" , Name : "pty_callback" ,
67
- })
68
- registerer .MustRegister (ptyCallback )
69
-
70
- reversePortForwardingCallback := prometheus .NewCounter (prometheus.CounterOpts {
71
- Namespace : "agent" , Subsystem : "ssh_server" , Name : "reverse_port_forwarding_callback" ,
72
- })
73
- registerer .MustRegister (reversePortForwardingCallback )
74
-
75
- x11Callback := prometheus .NewCounter (prometheus.CounterOpts {
76
- Namespace : "agent" , Subsystem : "ssh_server" , Name : "x11_callback" ,
77
- })
78
- registerer .MustRegister (x11Callback )
79
-
80
55
sftpHandler := prometheus .NewCounter (prometheus.CounterOpts {
81
56
Namespace : "agent" , Subsystem : "ssh_server" , Name : "sftp_handler" ,
82
57
})
@@ -105,16 +80,12 @@ func newSSHServerMetrics(registerer prometheus.Registerer) *sshServerMetrics {
105
80
sessions := newSessionMetrics (registerer )
106
81
107
82
return & sshServerMetrics {
108
- connectionFailedCallback : connectionFailedCallback ,
109
- localPortForwardingCallback : localPortForwardingCallback ,
110
- ptyCallback : ptyCallback ,
111
- reversePortForwardingCallback : reversePortForwardingCallback ,
112
- x11Callback : x11Callback ,
113
- sftpHandler : sftpHandler ,
114
- sftpServerError : sftpServerError ,
115
- x11HostnameError : x11HostnameError ,
116
- x11SocketDirError : x11SocketDirError ,
117
- x11XauthorityError : x11XauthorityError ,
83
+ connectionFailedCallback : connectionFailedCallback ,
84
+ sftpHandler : sftpHandler ,
85
+ sftpServerError : sftpServerError ,
86
+ x11HostnameError : x11HostnameError ,
87
+ x11SocketDirError : x11SocketDirError ,
88
+ x11XauthorityError : x11XauthorityError ,
118
89
119
90
sessions : sessions ,
120
91
}
0 commit comments