Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
<PackageVersion Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="5.6.0" />
<PackageVersion Include="Microsoft.Coyote" Version="1.7.11" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.14" />
<PackageVersion Include="Microsoft.Extensions.Diagnostics" Version="11.0.0-rc.3.26522.148" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="10.0.14" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="10.0.14" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.14" />
Expand Down
4 changes: 4 additions & 0 deletions src/OpenTelemetry/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ Notes](../../RELEASENOTES.md).
a reset.
([#8064](https://github.com/open-telemetry/opentelemetry-dotnet/pull/8064))

* Fixed tracing callbacks continuing after provider shutdown or disposal on older
target frameworks.
([#8065](https://github.com/open-telemetry/opentelemetry-dotnet/pull/8065))

## 1.21.0-rc.1

Released 2026-Oct-28
Expand Down
8 changes: 4 additions & 4 deletions src/OpenTelemetry/Trace/TracerProviderSdk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ internal bool OnShutdown(int timeoutMilliseconds)

this.Instrumentations.Clear();

#if NET11_0_OR_GREATER
#if !NET10_0
this.DetachTracingBridge();
#endif

Expand All @@ -403,7 +403,7 @@ protected override void Dispose(bool disposing)

this.Instrumentations.Clear();

#if NET11_0_OR_GREATER
#if !NET10_0
// Stop forwarding from the listener owned by ActivitySourceFactory before
// the sampler and processors are disposed, as it outlives this provider.
this.DetachTracingBridge();
Expand Down Expand Up @@ -694,14 +694,14 @@ private static ActivitySamplingResult PropagateOrIgnoreData(ref ActivityCreation
: ActivitySamplingResult.None;
}

#if NET11_0_OR_GREATER
#if !NET10_0
private void DetachTracingBridge()
=> this.tracingBridge?.Detach(this);
#endif

private void DisposeBuiltState(TracerProviderBuilderSdk state)
{
#if NET11_0_OR_GREATER
#if !NET10_0
this.DetachTracingBridge();
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.TestHost" Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'" />
<PackageReference Include="Microsoft.Extensions.Diagnostics" Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'" />
<PackageReference Include="Microsoft.Extensions.Hosting" Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Diagnostics;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
#if NET11_0_OR_GREATER
#if !NET10_0
using Microsoft.Extensions.Diagnostics.Tracing;
#endif
using Microsoft.Extensions.Hosting;
Expand Down Expand Up @@ -206,7 +206,7 @@ public void AddOpenTelemetry_WithTracing_NestedResolutionUsingConfigureTest()
Assert.True(innerTestExecuted);
}

#if NET11_0_OR_GREATER
#if !NET10_0
[Theory]
[InlineData(true, false, 1)]
[InlineData(false, false, 0)]
Expand Down Expand Up @@ -892,7 +892,7 @@ protected override Task ExecuteAsync(CancellationToken stoppingToken)
}
}

#if NET11_0_OR_GREATER
#if !NET10_0
private class CountingProcessor : BaseProcessor<Activity>
{
public int Started { get; private set; }
Expand Down
Loading