Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[otelhttp] Remove propagation header injection #2180

Merged
merged 4 commits into from Apr 12, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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)
- otelhttp: Stopped injecting propagation context into response headers (#2180)
TylerHelmuth marked this conversation as resolved.
Show resolved Hide resolved

## [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)
}