NServiceBus icon indicating copy to clipboard operation
NServiceBus copied to clipboard

[.NET 7] Use new Activity and ActivityContext APIs

Open timbussmann opened this issue 3 years ago • 0 comments

https://github.com/Particular/NServiceBus/pull/6585 had to use some code that can be simplified with the new APIs available in .NET 7:

  • https://github.com/dotnet/runtime/issues/42575 brings a ActivityContext.TryParse overload that offers an isRemote parameter that can be used to replace the workaround here: https://github.com/Particular/NServiceBus/blob/master/src/NServiceBus.Core/OpenTelemetry/Tracing/ActivityFactory.cs#L32
  • Activity.HasRemoteParent can be used in related unit tests to verify that the remote flag is correctly set and ensure this behavior is properly tested.

timbussmann avatar Nov 03 '22 15:11 timbussmann