From a86b2a3634301c59aa94b93e54997ffc61be01c4 Mon Sep 17 00:00:00 2001 From: TylerHelmuth <12352919+TylerHelmuth@users.noreply.github.com> Date: Mon, 11 Apr 2022 11:29:04 -0600 Subject: [PATCH 1/3] remove propagation header injection --- instrumentation/net/http/otelhttp/test/handler_test.go | 3 --- instrumentation/net/http/otelhttp/wrap.go | 1 - 2 files changed, 4 deletions(-) diff --git a/instrumentation/net/http/otelhttp/test/handler_test.go b/instrumentation/net/http/otelhttp/test/handler_test.go index 846da724d51..59909cf7b53 100644 --- a/instrumentation/net/http/otelhttp/test/handler_test.go +++ b/instrumentation/net/http/otelhttp/test/handler_test.go @@ -91,9 +91,6 @@ func TestHandlerBasics(t *testing.T) { if got, expected := rr.Result().StatusCode, http.StatusOK; got != expected { t.Fatalf("got %d, expected %d", got, expected) } - if got := rr.Header().Get("Traceparent"); got == "" { - t.Fatal("expected non empty trace header") - } spans := spanRecorder.Ended() if got, expected := len(spans), 1; got != expected { diff --git a/instrumentation/net/http/otelhttp/wrap.go b/instrumentation/net/http/otelhttp/wrap.go index b453b92e4cc..d55f0d6f5a9 100644 --- a/instrumentation/net/http/otelhttp/wrap.go +++ b/instrumentation/net/http/otelhttp/wrap.go @@ -91,6 +91,5 @@ func (w *respWriterWrapper) WriteHeader(statusCode int) { } w.wroteHeader = true w.statusCode = statusCode - w.props.Inject(w.ctx, propagation.HeaderCarrier(w.Header())) w.ResponseWriter.WriteHeader(statusCode) } From cee2b26dac4a1e6cc9b08756aaa18839db9b4efb Mon Sep 17 00:00:00 2001 From: TylerHelmuth <12352919+TylerHelmuth@users.noreply.github.com> Date: Mon, 11 Apr 2022 13:53:20 -0600 Subject: [PATCH 2/3] Updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dbf3b96ad4e..848df5b85f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - Fix the `otelmux` middleware by using `SpanKindServer` when deciding the `SpanStatus`. This makes `4xx` response codes to not be an error anymore. (#1973) - Fixed jaegerremote sampler not behaving properly with per operation strategy set. (#2137) +- otelhttp: Stopped injecting propagation context into response headers (#2180) ## [1.6.0/0.31.0] - 2022-03-28 From 8bff6f7540bb3d5f8ba458d7a085b2884839ce50 Mon Sep 17 00:00:00 2001 From: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com> Date: Tue, 12 Apr 2022 13:35:48 -0600 Subject: [PATCH 3/3] Update CHANGELOG.md Co-authored-by: Chester Cheung --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 848df5b85f9..d34cf803f27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - Fix the `otelmux` middleware by using `SpanKindServer` when deciding the `SpanStatus`. This makes `4xx` response codes to not be an error anymore. (#1973) - Fixed jaegerremote sampler not behaving properly with per operation strategy set. (#2137) -- otelhttp: Stopped injecting propagation context into response headers (#2180) +- Stopped injecting propagation context into response headers in otelhttp. (#2180) ## [1.6.0/0.31.0] - 2022-03-28