@@ -104,10 +104,12 @@ func (t *Tunnel) ServeHTTP(w http.ResponseWriter, r *http.Request) {
104104 connected : connected ,
105105 start : time .Now (),
106106 backend : backend ,
107+ dialID : random ,
108+ agentID : backend .GetAgentID (),
107109 }
108110 t .Server .PendingDial .Add (random , connection )
109111 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 )
111113 return
112114 }
113115 ctxt := backend .Context ()
@@ -142,22 +144,22 @@ func (t *Tunnel) ServeHTTP(w http.ResponseWriter, r *http.Request) {
142144 conn .Close ()
143145 }()
144146
145- klog .V (3 ).InfoS ("Starting proxy to host" , "host" , r .Host )
146- pkt := make ([]byte , 1 << 15 ) // Match GRPC Window size
147-
148147 connID := connection .connectID
149148 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
150152 var acc int
151153
152154 for {
153155 n , err := bufrw .Read (pkt [:])
154156 acc += n
155157 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 )
157159 break
158160 }
159161 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 )
161163 break
162164 }
163165
@@ -172,7 +174,7 @@ func (t *Tunnel) ServeHTTP(w http.ResponseWriter, r *http.Request) {
172174 }
173175 err = backend .Send (packet )
174176 if err != nil {
175- klog .ErrorS (err , "error sending packet" )
177+ klog .ErrorS (err , "error sending packet" , "host" , r . Host , "agentID" , agentID , "connectionID" , connID )
176178 break
177179 }
178180 klog .V (5 ).InfoS ("Forwarding data on tunnel to agent" ,
0 commit comments