diff --git a/api/correlation/correlation_context_propagator.go b/api/correlation/correlation_context_propagator.go index 20e1cd6af..172a3b902 100644 --- a/api/correlation/correlation_context_propagator.go +++ b/api/correlation/correlation_context_propagator.go @@ -23,7 +23,9 @@ import ( "go.opentelemetry.io/otel/api/propagation" ) -const correlationContextHeader = "Correlation-Context" +// Temporary header name until W3C finalizes format. +// https://github.com/open-telemetry/opentelemetry-specification/blob/18b2752ebe6c7f0cdd8c7b2bcbdceb0ae3f5ad95/specification/correlationcontext/api.md#header-name +const correlationContextHeader = "otcorrelations" // CorrelationContext propagates Key:Values in W3C CorrelationContext // format. diff --git a/api/correlation/correlation_context_propagator_test.go b/api/correlation/correlation_context_propagator_test.go index 3fe832fa6..5a88133eb 100644 --- a/api/correlation/correlation_context_propagator_test.go +++ b/api/correlation/correlation_context_propagator_test.go @@ -89,7 +89,7 @@ func TestExtractValidDistributedContextFromHTTPReq(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { req, _ := http.NewRequest("GET", "http://example.com", nil) - req.Header.Set("Correlation-Context", tt.header) + req.Header.Set("otcorrelations", tt.header) ctx := context.Background() ctx = propagation.ExtractHTTP(ctx, props, req.Header) @@ -133,7 +133,7 @@ func TestExtractInvalidDistributedContextFromHTTPReq(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { req, _ := http.NewRequest("GET", "http://example.com", nil) - req.Header.Set("Correlation-Context", tt.header) + req.Header.Set("otcorrelations", tt.header) ctx := context.Background() ctx = propagation.ExtractHTTP(ctx, props, req.Header) @@ -202,17 +202,17 @@ func TestInjectCorrelationContextToHTTPReq(t *testing.T) { ctx := correlation.ContextWithMap(context.Background(), correlation.NewMap(correlation.MapUpdate{MultiKV: tt.kvs})) propagation.InjectHTTP(ctx, props, req.Header) - gotHeader := req.Header.Get("Correlation-Context") + gotHeader := req.Header.Get("otcorrelations") wantedLen := len(strings.Join(tt.wantInHeader, ",")) if wantedLen != len(gotHeader) { t.Errorf( - "%s: Inject Correlation-Context incorrect length %d != %d.", tt.name, tt.wantedLen, len(gotHeader), + "%s: Inject otcorrelations incorrect length %d != %d.", tt.name, tt.wantedLen, len(gotHeader), ) } for _, inHeader := range tt.wantInHeader { if !strings.Contains(gotHeader, inHeader) { t.Errorf( - "%s: Inject Correlation-Context missing part of header: %s in %s", tt.name, inHeader, gotHeader, + "%s: Inject otcorrelations missing part of header: %s in %s", tt.name, inHeader, gotHeader, ) } } @@ -222,7 +222,7 @@ func TestInjectCorrelationContextToHTTPReq(t *testing.T) { func TestTraceContextPropagator_GetAllKeys(t *testing.T) { var propagator correlation.CorrelationContext - want := []string{"Correlation-Context"} + want := []string{"otcorrelations"} got := propagator.GetAllKeys() if diff := cmp.Diff(got, want); diff != "" { t.Errorf("GetAllKeys: -got +want %s", diff)