Closed Kielek closed 1 month ago
Potential diff for contrib repo:
diff --git a/src/OpenTelemetry.Extensions.AWS/.publicApi/PublicAPI.Unshipped.txt b/src/OpenTelemetry.Extensions.AWS/.publicApi/PublicAPI.Unshipped.txt
index a7a1588b..cc69db22 100644
--- a/src/OpenTelemetry.Extensions.AWS/.publicApi/PublicAPI.Unshipped.txt
+++ b/src/OpenTelemetry.Extensions.AWS/.publicApi/PublicAPI.Unshipped.txt
@@ -2,7 +2,7 @@ OpenTelemetry.Extensions.AWS.AWSXRayIdGenerator
OpenTelemetry.Extensions.AWS.Trace.AWSXRayPropagator
OpenTelemetry.Extensions.AWS.Trace.AWSXRayPropagator.AWSXRayPropagator() -> void
OpenTelemetry.Trace.TracerProviderBuilderExtensions
-override OpenTelemetry.Extensions.AWS.Trace.AWSXRayPropagator.Extract<T>(OpenTelemetry.Context.Propagation.PropagationContext context, T carrier, System.Func<T, string!, System.Collections.Generic.IEnumerable<string!>!>! getter) -> OpenTelemetry.Context.Propagation.PropagationContext
+override OpenTelemetry.Extensions.AWS.Trace.AWSXRayPropagator.Extract<T>(OpenTelemetry.Context.Propagation.PropagationContext context, T carrier, System.Func<T, string!, System.Collections.Generic.IEnumerable<string!>?>! getter) -> OpenTelemetry.Context.Propagation.PropagationContext
override OpenTelemetry.Extensions.AWS.Trace.AWSXRayPropagator.Fields.get -> System.Collections.Generic.ISet<string!>!
override OpenTelemetry.Extensions.AWS.Trace.AWSXRayPropagator.Inject<T>(OpenTelemetry.Context.Propagation.PropagationContext context, T carrier, System.Action<T, string!, string!>! setter) -> void
static OpenTelemetry.Trace.TracerProviderBuilderExtensions.AddXRayTraceId(this OpenTelemetry.Trace.TracerProviderBuilder! builder) -> OpenTelemetry.Trace.TracerProviderBuilder!
diff --git a/src/OpenTelemetry.Extensions.AWS/Trace/AWSXRayPropagator.cs b/src/OpenTelemetry.Extensions.AWS/Trace/AWSXRayPropagator.cs
index 569bae53..4e8d5ac8 100644
--- a/src/OpenTelemetry.Extensions.AWS/Trace/AWSXRayPropagator.cs
+++ b/src/OpenTelemetry.Extensions.AWS/Trace/AWSXRayPropagator.cs
@@ -38,7 +38,7 @@ public class AWSXRayPropagator : TextMapPropagator
public override ISet<string> Fields => new HashSet<string>() { AWSXRayTraceHeaderKey };
/// <inheritdoc/>
- public override PropagationContext Extract<T>(PropagationContext context, T carrier, Func<T, string, IEnumerable<string>> getter)
+ public override PropagationContext Extract<T>(PropagationContext context, T carrier, Func<T, string, IEnumerable<string>?> getter)
{
if (context.ActivityContext.IsValid())
{
diff --git a/test/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests/ActivityHelperTest.cs b/test/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests/ActivityHelperTest.cs
index 0e7bacce..d5dabf7c 100644
--- a/test/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests/ActivityHelperTest.cs
+++ b/test/OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule.Tests/ActivityHelperTest.cs
@@ -555,7 +555,7 @@ public class ActivityHelperTest : IDisposable
{
public override ISet<string>? Fields => null;
- public override PropagationContext Extract<T>(PropagationContext context, T carrier, Func<T, string, IEnumerable<string>> getter)
+ public override PropagationContext Extract<T>(PropagationContext context, T carrier, Func<T, string, IEnumerable<string>?> getter)
{
return default;
}
diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/BasicTests.cs b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/BasicTests.cs
index 03cc1600..4eeed567 100644
--- a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/BasicTests.cs
+++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/BasicTests.cs
@@ -1202,7 +1202,7 @@ public sealed class BasicTests
public override ISet<string> Fields => throw new NotImplementedException();
- public override PropagationContext Extract<T>(PropagationContext context, T carrier, Func<T, string, IEnumerable<string>> getter)
+ public override PropagationContext Extract<T>(PropagationContext context, T carrier, Func<T, string, IEnumerable<string>?> getter)
{
return new PropagationContext(this.activityContext, this.baggage);
}
diff --git a/test/OpenTelemetry.Instrumentation.GrpcCore.Tests/GrpcCoreClientInterceptorTests.cs b/test/OpenTelemetry.Instrumentation.GrpcCore.Tests/GrpcCoreClientInterceptorTests.cs
index 150f20a3..57db6c4d 100644
--- a/test/OpenTelemetry.Instrumentation.GrpcCore.Tests/GrpcCoreClientInterceptorTests.cs
+++ b/test/OpenTelemetry.Instrumentation.GrpcCore.Tests/GrpcCoreClientInterceptorTests.cs
@@ -389,9 +389,11 @@ public class GrpcCoreClientInterceptorTests
{
propagatorCalled++;
capturedPropagationContext = propagation;
- capturedCarrier = (Metadata)carrier;
+ capturedCarrier = (Metadata?)carrier;
// Make sure the original metadata make it through
+
+ Assert.NotNull(capturedCarrier);
if (additionalMetadata != null)
{
Assert.Equal(capturedCarrier, additionalMetadata);
diff --git a/test/Shared/CustomTextMapPropagator.cs b/test/Shared/CustomTextMapPropagator.cs
index 8d3404e8..fc869441 100644
--- a/test/Shared/CustomTextMapPropagator.cs
+++ b/test/Shared/CustomTextMapPropagator.cs
@@ -24,7 +24,7 @@ internal sealed class CustomTextMapPropagator : TextMapPropagator
#pragma warning restore SA1010 // Opening square brackets should be spaced correctly
#pragma warning restore SA1201 // Elements should appear in the correct order
- public override PropagationContext Extract<T>(PropagationContext context, T carrier, Func<T, string, IEnumerable<string>> getter)
+ public override PropagationContext Extract<T>(PropagationContext context, T carrier, Func<T, string, IEnumerable<string>?> getter)
{
if (this.TraceId != default && this.SpanId != default)
{
diff --git a/test/Shared/TestTextMapPropagator.cs b/test/Shared/TestTextMapPropagator.cs
index ba58606a..5c2c36da 100644
--- a/test/Shared/TestTextMapPropagator.cs
+++ b/test/Shared/TestTextMapPropagator.cs
@@ -9,13 +9,13 @@ namespace OpenTelemetry.Tests;
internal class TestTextMapPropagator : TextMapPropagator
{
- public Action<PropagationContext, object, Action<object, string, string>>? OnInject { get; set; }
+ public Action<PropagationContext, object?, Action<object, string, string>>? OnInject { get; set; }
public Action? Extracted { get; set; }
public override ISet<string> Fields => throw new NotImplementedException();
- public override PropagationContext Extract<T>(PropagationContext context, T carrier, Func<T, string, IEnumerable<string>> getter)
+ public override PropagationContext Extract<T>(PropagationContext context, T carrier, Func<T, string, IEnumerable<string>?> getter)
{
this.Extracted?.Invoke();
return context;
@@ -23,10 +23,9 @@ internal class TestTextMapPropagator : TextMapPropagator
public override void Inject<T>(PropagationContext context, T carrier, Action<T, string, string> setter)
{
- var newAction = new Action<T, string, string>((c, k, v) => setter(c, k, v));
this.OnInject?.Invoke(
context,
carrier,
- new Action<object, string, string>((c, k, v) => setter((T)c, k, v)));
+ (c, k, v) => setter((T)c, k, v));
}
}
Attention: Patch coverage is 81.81818%
with 4 lines
in your changes missing coverage. Please review.
Project coverage is 86.21%. Comparing base (
6250307
) to head (8bb5e43
). Report is 299 commits behind head on main.
Files with missing lines | Patch % | Lines |
---|---|---|
src/OpenTelemetry.Api/Trace/SpanContext.cs | 0.00% | 3 Missing :warning: |
...etry.Api/Context/Propagation/PropagationContext.cs | 0.00% | 1 Missing :warning: |
This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or Pushing will instruct the bot to automatically remove the label. This bot runs once per day.
This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or pushing will instruct the bot to automatically remove the label. This bot runs once per day.
Towards #3958
Changes
[Propagators] Nullable
Merge requirement checklist
[ ] AppropriateCHANGELOG.md
files updated for non-trivial changes