Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
5d40e60
[AspNetCore] Avoid adding tags for traces
martincostello Mar 19, 2026
4423e89
[AspNetCore] Update CHANGELOG
martincostello Mar 19, 2026
1ea52fd
[AspNetCore] Fix lint warning
martincostello Mar 19, 2026
2409aa4
Merge branch 'main' into aspnetcore-avoid-tags-where-possible
martincostello Mar 20, 2026
e83d19c
Merge branch 'main' into aspnetcore-avoid-tags-where-possible
martincostello Mar 27, 2026
b5abf77
[AspNetCore] Fix comments
martincostello Mar 27, 2026
22c1885
[AspNetCore] Address review comment
martincostello Mar 27, 2026
af57940
[AspNetCore] Add schema URL to traces
martincostello Apr 6, 2026
1567aab
[AspNetCore] Update tests
martincostello Apr 6, 2026
f73911e
[AspNetCore] Address comments
martincostello Apr 6, 2026
5614b3b
[AspNetCore] Use ActivitySourceFactory
martincostello Apr 9, 2026
1e2cf4d
[AspNetCore] Fix tests
martincostello Apr 9, 2026
f5de0fd
Merge branch 'main' into aspnetcore-avoid-tags-where-possible
martincostello Apr 9, 2026
bebb82a
[AspNetCore] Fix lint warning
martincostello Apr 9, 2026
e9bcd6f
[AspNetCore] Fix spacing
martincostello Apr 9, 2026
c313046
[AspNetCore] Optimize HttpInListener
martincostello Apr 10, 2026
509e280
[AspNetCore] Extend test coverage
martincostello Apr 11, 2026
e48264a
[AspNetCore] Add lower bounds check
martincostello Apr 11, 2026
e6584f3
[AspNetCore] Simplify benchmarks
martincostello Apr 11, 2026
4146fa1
[AspNetCore] Add gRPC benchmark
martincostello Apr 11, 2026
308a49e
[AspNetCore] Fix gRPC benchmark
martincostello Apr 11, 2026
ac59c97
[AspNetCore] Avoid try blocks
martincostello Apr 11, 2026
6cb6b88
[AspNetCore] Simplify benchmarks
martincostello Apr 11, 2026
a2a2ff2
[AspNetCore] Avoid redundant work
martincostello Apr 11, 2026
4668d00
[AspNetCore] Address feedback
martincostello Apr 11, 2026
e1847f9
[AspNetCore] Address feedback
martincostello Apr 11, 2026
57d3776
[AspNetCore] Use constant
martincostello Apr 11, 2026
4cd813b
[AspNetCore] Avoid extra call
martincostello Apr 11, 2026
d938c99
[AspNetCore] Update README
martincostello Apr 12, 2026
fcdd9f5
Merge branch 'aspnetcore-avoid-tags-where-possible' into performance-…
martincostello Apr 12, 2026
d142071
Merge branch 'gh-4064-aspnetcore' into performance-improvements
martincostello Apr 12, 2026
8e86d03
Merge branch 'optimize-HttpInListener' into performance-improvements
martincostello Apr 12, 2026
c187dc0
[AspNetCore] Fix merge
martincostello Apr 12, 2026
8eb13b0
Merge branch 'simplify-aspnetcode-benchmarks' into performance-improv…
martincostello Apr 12, 2026
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
3 changes: 3 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="8.0.25" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.25" />
<PackageVersion Include="Microsoft.AspNetCore.SignalR.Client" Version="8.0.25" />
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="8.0.25" />
<PackageVersion Include="Microsoft.Data.SqlClient" Version="7.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.25" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.25" />
Expand Down Expand Up @@ -151,11 +152,13 @@
<PackageVersion Update="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="9.0.14" />
<PackageVersion Update="Microsoft.AspNetCore.Mvc.Testing" Version="9.0.14" />
<PackageVersion Update="Microsoft.AspNetCore.SignalR.Client" Version="9.0.14" />
<PackageVersion Update="Microsoft.AspNetCore.TestHost" Version="9.0.14" />
</ItemGroup>
<ItemGroup Condition="$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net10.0'))" Label="Non-production packages, such as for examples and tests, for .NET 10">
<PackageVersion Update="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="10.0.5" />
<PackageVersion Update="Microsoft.AspNetCore.Mvc.Testing" Version="10.0.5" />
<PackageVersion Update="Microsoft.AspNetCore.SignalR.Client" Version="10.0.5" />
<PackageVersion Update="Microsoft.AspNetCore.TestHost" Version="10.0.5" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ internal sealed class AspNetCoreInstrumentation : IDisposable
"Microsoft.AspNetCore.Hosting.UnhandledException"
];

private readonly Func<string, object?, object?, bool> isEnabled = (eventName, _, _)
private readonly Func<string, object?, object?, bool> isEnabled = static (eventName, _, _)
=> DiagnosticSourceEvents.Contains(eventName);

private readonly DiagnosticSourceSubscriber diagnosticSourceSubscriber;
Expand All @@ -32,7 +32,5 @@ public AspNetCoreInstrumentation(HttpInListener httpInListener)

/// <inheritdoc/>
public void Dispose()
{
this.diagnosticSourceSubscriber?.Dispose();
}
=> this.diagnosticSourceSubscriber?.Dispose();
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ public static TracerProviderBuilder AddAspNetCoreInstrumentation(
return builder.AddInstrumentation(sp =>
{
var options = sp.GetRequiredService<IOptionsMonitor<AspNetCoreTraceInstrumentationOptions>>().Get(name);

return new AspNetCoreInstrumentation(
new HttpInListener(options));
return new AspNetCoreInstrumentation(new HttpInListener(options));
});
}

Expand All @@ -102,9 +100,9 @@ private static void AddAspNetCoreInstrumentationSources(
string optionsName,
IServiceProvider? serviceProvider = null)
{
// For .NET7.0 onwards activity will be created using activitySource.
// For .NET 7.0+ the activity will be created using activitySource.
// https://github.com/dotnet/aspnetcore/blob/bf3352f2422bf16fa3ca49021f0e31961ce525eb/src/Hosting/Hosting/src/Internal/HostingApplicationDiagnostics.cs#L327
// For .NET6.0 and below, we will continue to use legacy way.
// For .NET 6.0 and below, we will continue to use legacy way.
if (HttpInListener.Net7OrGreater)
{
// TODO: Check with .NET team to see if this can be prevented
Expand All @@ -122,7 +120,7 @@ private static void AddAspNetCoreInstrumentationSources(
}
else
{
builder.AddSource(HttpInListener.ActivitySourceName);
builder.AddSource(HttpInListener.ActivitySource.Name);
builder.AddLegacySource(HttpInListener.ActivityOperationName); // for the activities created by AspNetCore
}

Expand Down
9 changes: 9 additions & 0 deletions src/OpenTelemetry.Instrumentation.AspNetCore/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@
* Updated OpenTelemetry core component version(s) to `1.15.2`.
([#4080](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/4080))

* Avoid duplicative work to add tags to traces when they are already natively supported
by ASP.NET Core itself. When using ASP.NET Core 10, performance can be
improved by setting the `Microsoft.AspNetCore.Hosting.SuppressActivityOpenTelemetryData`
AppContext switch to `false` (its default value is `true`).
([#3993](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/3993))

* Add instrumentation schema URL to traces for `netstandard2.0`.
([#4066](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/4066))

## 1.15.1

Released 2026-Mar-11
Expand Down
Loading
Loading