Skip to content

Commit

Permalink
[otelhttp] Remove propagation header injection (#2180)
Browse files Browse the repository at this point in the history
* remove propagation header injection

* Updated changelog

* Update CHANGELOG.md

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
  • Loading branch information
TylerHelmuth and hanyuancheung committed Apr 12, 2022
1 parent 9fafa35 commit 9d80058
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -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)
- Stopped injecting propagation context into response headers in otelhttp. (#2180)

## [1.6.0/0.31.0] - 2022-03-28

Expand Down
3 changes: 0 additions & 3 deletions instrumentation/net/http/otelhttp/test/handler_test.go
Expand Up @@ -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 {
Expand Down
1 change: 0 additions & 1 deletion instrumentation/net/http/otelhttp/wrap.go
Expand Up @@ -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)
}

0 comments on commit 9d80058

Please sign in to comment.