Skip to content

Commit

Permalink
Fix header name to associate log entry & trace (#263)
Browse files Browse the repository at this point in the history
  • Loading branch information
pokutuna committed Dec 30, 2021
1 parent 5a029e6 commit e005424
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion v2/internal/log.go
Expand Up @@ -108,7 +108,7 @@ func chunkLog(msg string) []string {
}

func traceAndSpan(c *context) (string, string) {
headers := c.req.Header["Cloud-Trace-Context"]
headers := c.req.Header["X-Cloud-Trace-Context"]
if len(headers) < 1 {
return "", ""
}
Expand Down
2 changes: 1 addition & 1 deletion v2/internal/log_test.go
Expand Up @@ -437,7 +437,7 @@ func buildContextWithTraceHeaders(t *testing.T, headers []string) *context {
t.Fatal(err)
}
for _, h := range headers {
req.Header.Add("Cloud-Trace-Context", h)
req.Header.Add("X-Cloud-Trace-Context", h)
}
return fromContext(ContextForTesting(req))
}

0 comments on commit e005424

Please sign in to comment.