diff --git a/connection/connection.go b/connection/connection.go index 5200f4bb..be72b5d2 100644 --- a/connection/connection.go +++ b/connection/connection.go @@ -174,6 +174,7 @@ func (h *HTTPResponseReadWriteAcker) AckConnection(tracePropagation string) erro Status: switchingProtocolText, StatusCode: http.StatusSwitchingProtocols, ContentLength: -1, + Header: http.Header{}, } if secWebsocketKey := h.req.Header.Get("Sec-WebSocket-Key"); secWebsocketKey != "" { diff --git a/connection/http2.go b/connection/http2.go index 1b78d748..8b488010 100644 --- a/connection/http2.go +++ b/connection/http2.go @@ -149,9 +149,10 @@ func (c *HTTP2Connection) ServeHTTP(w http.ResponseWriter, r *http.Request) { rws := NewHTTPResponseReadWriterAcker(respWriter, r) if err := originProxy.ProxyTCP(r.Context(), rws, &TCPRequest{ - Dest: host, - CFRay: FindCfRayHeader(r), - LBProbe: IsLBProbeRequest(r), + Dest: host, + CFRay: FindCfRayHeader(r), + LBProbe: IsLBProbeRequest(r), + CfTraceID: r.Header.Get(tracing.TracerContextName), }); err != nil { respWriter.WriteErrorResponse() } diff --git a/proxy/proxy.go b/proxy/proxy.go index 0c2c21c0..9bc37615 100644 --- a/proxy/proxy.go +++ b/proxy/proxy.go @@ -256,7 +256,7 @@ func (p *Proxy) proxyStream( connectionProxy ingress.StreamBasedOriginProxy, ) error { ctx := tr.Context - _, connectSpan := tr.Tracer().Start(ctx, "stream_connect") + _, connectSpan := tr.Tracer().Start(ctx, "stream-connect") originConn, err := connectionProxy.EstablishConnection(ctx, dest) if err != nil { tracing.EndWithErrorStatus(connectSpan, err) diff --git a/proxy/proxy_test.go b/proxy/proxy_test.go index f85281b3..da90288e 100644 --- a/proxy/proxy_test.go +++ b/proxy/proxy_test.go @@ -525,6 +525,7 @@ func TestConnections(t *testing.T) { }, want: want{ message: []byte("echo-test2"), + headers: http.Header{}, }, }, { @@ -544,6 +545,7 @@ func TestConnections(t *testing.T) { message: []byte("echo-test3"), // We expect no headers here because they are sent back via // the stream. + headers: http.Header{}, }, }, {