diff --git a/v2/internal/log.go b/v2/internal/log.go index e4f14ba6..210df597 100644 --- a/v2/internal/log.go +++ b/v2/internal/log.go @@ -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 "", "" } diff --git a/v2/internal/log_test.go b/v2/internal/log_test.go index aeecb43e..b724153d 100644 --- a/v2/internal/log_test.go +++ b/v2/internal/log_test.go @@ -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)) }