@@ -104,10 +104,12 @@ func (t *Tunnel) ServeHTTP(w http.ResponseWriter, r *http.Request) {
104
104
connected : connected ,
105
105
start : time .Now (),
106
106
backend : backend ,
107
+ dialID : random ,
108
+ agentID : backend .GetAgentID (),
107
109
}
108
110
t .Server .PendingDial .Add (random , connection )
109
111
if err := backend .Send (dialRequest ); err != nil {
110
- klog .ErrorS (err , "failed to tunnel dial request" )
112
+ klog .ErrorS (err , "failed to tunnel dial request" , "host" , r . Host , "dialID" , connection . dialID , "agentID" , connection . agentID )
111
113
return
112
114
}
113
115
ctxt := backend .Context ()
@@ -142,22 +144,22 @@ func (t *Tunnel) ServeHTTP(w http.ResponseWriter, r *http.Request) {
142
144
conn .Close ()
143
145
}()
144
146
145
- klog .V (3 ).InfoS ("Starting proxy to host" , "host" , r .Host )
146
- pkt := make ([]byte , 1 << 15 ) // Match GRPC Window size
147
-
148
147
connID := connection .connectID
149
148
agentID := connection .agentID
149
+ klog .V (3 ).InfoS ("Starting proxy to host" , "host" , r .Host , "agentID" , agentID , "connectionID" , connID )
150
+
151
+ pkt := make ([]byte , 1 << 15 ) // Match GRPC Window size
150
152
var acc int
151
153
152
154
for {
153
155
n , err := bufrw .Read (pkt [:])
154
156
acc += n
155
157
if err == io .EOF {
156
- klog .V (1 ).InfoS ("EOF from host" , "host" , r .Host )
158
+ klog .V (1 ).InfoS ("EOF from host" , "host" , r .Host , "agentID" , agentID , "connectionID" , connID )
157
159
break
158
160
}
159
161
if err != nil {
160
- klog .ErrorS (err , "Received failure on connection" )
162
+ klog .ErrorS (err , "Received failure on connection" , "host" , r . Host , "agentID" , agentID , "connectionID" , connID )
161
163
break
162
164
}
163
165
@@ -172,7 +174,7 @@ func (t *Tunnel) ServeHTTP(w http.ResponseWriter, r *http.Request) {
172
174
}
173
175
err = backend .Send (packet )
174
176
if err != nil {
175
- klog .ErrorS (err , "error sending packet" )
177
+ klog .ErrorS (err , "error sending packet" , "host" , r . Host , "agentID" , agentID , "connectionID" , connID )
176
178
break
177
179
}
178
180
klog .V (5 ).InfoS ("Forwarding data on tunnel to agent" ,
0 commit comments