Skip to content

Commit

Permalink
Ensure clientTracer closes http.headers span (#912)
Browse files Browse the repository at this point in the history
Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
  • Loading branch information
Aneurysm9 and MrAlias authored Jul 7, 2020
1 parent 463c458 commit 1c6ca87
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

- The B3 Single Header name is now correctly `b3` instead of the previous `X-B3`. (#881)
- Ensure span status is not set to `Unknown` when no HTTP status code is provided as it is assumed to be `200 OK`. (#908)
- Ensure `httptrace.clientTracer` closes `http.headers` span. (#912)

## [0.7.0] - 2020-06-26

Expand Down
3 changes: 3 additions & 0 deletions instrumentation/httptrace/clienttrace.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@ func (ct *clientTracer) wroteHeaderField(k string, v []string) {
}

func (ct *clientTracer) wroteHeaders() {
if ct.span("http.headers") != nil {
ct.end("http.headers", nil)
}
ct.start("http.send", "http.send")
}

Expand Down
4 changes: 4 additions & 0 deletions instrumentation/httptrace/clienttrace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ func TestHTTPRequestWithClientTrace(t *testing.T) {
name: "http.receive",
parent: "test",
},
{
name: "http.headers",
parent: "test",
},
{
name: "http.send",
parent: "test",
Expand Down

0 comments on commit 1c6ca87

Please sign in to comment.