From eb42939cd5751f79a2198edcc5765e9d54d1674d Mon Sep 17 00:00:00 2001 From: Utkarsh Umesan Pillai <66651184+utpilla@users.noreply.github.com> Date: Tue, 20 Apr 2021 16:42:37 -0700 Subject: [PATCH] Rename Baggage Header name to baggage (#2003) * Rename Baggage Header name to baggage * Updated CHANGELOG.md --- src/OpenTelemetry.Api/CHANGELOG.md | 4 ++++ .../Context/Propagation/BaggagePropagator.cs | 2 +- .../HttpClientTests.Basic.netcore31.cs | 2 +- .../HttpWebRequestActivitySourceTests.netfx.cs | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/OpenTelemetry.Api/CHANGELOG.md b/src/OpenTelemetry.Api/CHANGELOG.md index a5cebe0542e..bc01c9e01b2 100644 --- a/src/OpenTelemetry.Api/CHANGELOG.md +++ b/src/OpenTelemetry.Api/CHANGELOG.md @@ -9,6 +9,10 @@ please check the latest changes ## Unreleased +* `BaggagePropagator` now uses `baggage` as the header name instead of `Baggage` + to `Extract` from and `Inject` to `carrier` + ([#2003](https://github.com/open-telemetry/opentelemetry-dotnet/pull/2003)) + ## 1.1.0-beta1 Released 2021-Mar-19 diff --git a/src/OpenTelemetry.Api/Context/Propagation/BaggagePropagator.cs b/src/OpenTelemetry.Api/Context/Propagation/BaggagePropagator.cs index 30808f642d5..cfeb5387c93 100644 --- a/src/OpenTelemetry.Api/Context/Propagation/BaggagePropagator.cs +++ b/src/OpenTelemetry.Api/Context/Propagation/BaggagePropagator.cs @@ -28,7 +28,7 @@ namespace OpenTelemetry.Context.Propagation /// public class BaggagePropagator : TextMapPropagator { - internal const string BaggageHeaderName = "Baggage"; + internal const string BaggageHeaderName = "baggage"; private const int MaxBaggageLength = 8192; private const int MaxBaggageItems = 180; diff --git a/test/OpenTelemetry.Instrumentation.Http.Tests/HttpClientTests.Basic.netcore31.cs b/test/OpenTelemetry.Instrumentation.Http.Tests/HttpClientTests.Basic.netcore31.cs index 47c74259116..317fcb24f55 100644 --- a/test/OpenTelemetry.Instrumentation.Http.Tests/HttpClientTests.Basic.netcore31.cs +++ b/test/OpenTelemetry.Instrumentation.Http.Tests/HttpClientTests.Basic.netcore31.cs @@ -392,7 +392,7 @@ public async Task HttpClientInstrumentationContextPropagation() Assert.True(request.Headers.TryGetValues("traceparent", out var traceparents)); Assert.True(request.Headers.TryGetValues("tracestate", out var tracestates)); - Assert.True(request.Headers.TryGetValues("Baggage", out var baggages)); + Assert.True(request.Headers.TryGetValues("baggage", out var baggages)); Assert.Single(traceparents); Assert.Single(tracestates); Assert.Single(baggages); diff --git a/test/OpenTelemetry.Instrumentation.Http.Tests/HttpWebRequestActivitySourceTests.netfx.cs b/test/OpenTelemetry.Instrumentation.Http.Tests/HttpWebRequestActivitySourceTests.netfx.cs index f6a944a63af..8f42f6b59c9 100644 --- a/test/OpenTelemetry.Instrumentation.Http.Tests/HttpWebRequestActivitySourceTests.netfx.cs +++ b/test/OpenTelemetry.Instrumentation.Http.Tests/HttpWebRequestActivitySourceTests.netfx.cs @@ -816,7 +816,7 @@ private static void ActivityEnrichment(Activity activity, string method, object private static void ValidateBaggage(HttpWebRequest request) { - string[] baggage = request.Headers["Baggage"].Split(','); + string[] baggage = request.Headers["baggage"].Split(','); Assert.Equal(3, baggage.Length); Assert.Contains("key=value", baggage);