Microsoft.AspNetCore.Diagnostics.Middleware
8.4.0
Prefix Reserved
See the version list below for details.
dotnet add package Microsoft.AspNetCore.Diagnostics.Middleware --version 8.4.0
NuGet\Install-Package Microsoft.AspNetCore.Diagnostics.Middleware -Version 8.4.0
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.Middleware" Version="8.4.0" />
<PackageVersion Include="Microsoft.AspNetCore.Diagnostics.Middleware" Version="8.4.0" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.Middleware" />
paket add Microsoft.AspNetCore.Diagnostics.Middleware --version 8.4.0
#r "nuget: Microsoft.AspNetCore.Diagnostics.Middleware, 8.4.0"
#:package Microsoft.AspNetCore.Diagnostics.Middleware@8.4.0
#addin nuget:?package=Microsoft.AspNetCore.Diagnostics.Middleware&version=8.4.0
#tool nuget:?package=Microsoft.AspNetCore.Diagnostics.Middleware&version=8.4.0
Microsoft.AspNetCore.Diagnostics.Middleware
HTTP request diagnostics middleware for tracking latency and enriching and redacting log output.
Install the package
From the command-line:
dotnet add package Microsoft.AspNetCore.Diagnostics.Middleware
Or directly in the C# project file:
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.Middleware" Version="[CURRENTVERSION]" />
</ItemGroup>
Usage Example
Tracking HTTP Request Latency
These components enable tracking and reporting the latency of HTTP request processing.
The services can be registered using the following methods:
public static IServiceCollection AddRequestCheckpoint(this IServiceCollection services)
public static IServiceCollection AddRequestLatencyTelemetry(this IServiceCollection services)
public static IServiceCollection AddRequestLatencyTelemetry(this IServiceCollection services, Action<RequestLatencyTelemetryOptions> configure)
public static IServiceCollection AddRequestLatencyTelemetry(this IServiceCollection services, IConfigurationSection section)
The middleware can be registered using the following methods:
public static IApplicationBuilder UseRequestCheckpoint(this IApplicationBuilder builder)
public static IApplicationBuilder UseRequestLatencyTelemetry(this IApplicationBuilder builder)
For example:
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddRequestLatencyTelemetry();
builder.Services.AddRequestCheckpoint(options => { });
var app = builder.Build();
app.UseRequestCheckpoint();
app.UseRequestLatencyTelemetry();
HTTP Request Logs Enrichment and Redaction
These components enable enriching and redacting ASP.NET Core's HTTP request logs.
These APIs are only available for ASP.NET Core 8+.
The services can be registered using the following methods:
public static IServiceCollection AddHttpLoggingRedaction(this IServiceCollection services, Action<HeaderParsingOptions>? configure = null)
public static IServiceCollection AddHttpLoggingRedaction(this IServiceCollection services, IConfigurationSection section)
public static IServiceCollection AddHttpLogEnricher<T>(this IServiceCollection services)
The middleware can be registered using the following method:
public static IApplicationBuilder UseHttpLogging(this IApplicationBuilder builder)
For example:
var builder = WebApplication.CreateBuilder(args);
// General logging options
builder.Services.AddHttpLogging(options => { });
// Redaction options
builder.Services.AddHttpLoggingRedaction(options => { });
var app = builder.Build();
app.UseHttpLogging();
Feedback & Contributing
We welcome feedback and contributions in our GitHub repo.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net6.0
- Microsoft.Extensions.Compliance.Abstractions (>= 8.4.0)
- Microsoft.Extensions.Configuration.Binder (>= 8.0.1)
- Microsoft.Extensions.DependencyInjection.AutoActivation (>= 8.4.0)
- Microsoft.Extensions.Telemetry (>= 8.4.0)
- Microsoft.Extensions.Telemetry.Abstractions (>= 8.4.0)
- System.Collections.Immutable (>= 8.0.0)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
-
net8.0
- Microsoft.Extensions.Compliance.Abstractions (>= 8.4.0)
- Microsoft.Extensions.Configuration.Binder (>= 8.0.1)
- Microsoft.Extensions.DependencyInjection.AutoActivation (>= 8.4.0)
- Microsoft.Extensions.Telemetry (>= 8.4.0)
- Microsoft.Extensions.Telemetry.Abstractions (>= 8.4.0)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on Microsoft.AspNetCore.Diagnostics.Middleware:
| Package | Downloads |
|---|---|
|
WC.Library.Web
Package Description |
|
|
BBT.Aether.HttpClient
Aether is a .NET Core framework designed to provide developers with a foundational structure and pre-built cross-cutting concerns. |
|
|
BBT.Aether.AspNetCore
Aether is a .NET Core framework designed to provide developers with a foundational structure and pre-built cross-cutting concerns. |
|
|
BBT.Prism.AspNetCore
Package Description |
GitHub repositories (3)
Showing the top 3 popular GitHub repositories that depend on Microsoft.AspNetCore.Diagnostics.Middleware:
| Repository | Stars |
|---|---|
|
dotnet/AspNetCore.Docs
Documentation for ASP.NET Core
|
|
|
mehdihadeli/food-delivery-microservices
🍔 A practical and cloud-native food delivery microservices, built with .Net Aspire, .Net 9, MassTransit, Domain-Driven Design, CQRS, Vertical Slice Architecture, Event-Driven Architecture, and the latest technologies.
|
|
|
foxminchan/BookWorm
The practical implementation of Aspire using Microservices, AI-Agents
|
| Version | Downloads | Last Updated |
|---|---|---|
| 10.3.0 | 5,919 | 2/10/2026 |
| 10.2.0 | 7,586 | 1/13/2026 |
| 10.1.0 | 9,565 | 12/9/2025 |
| 10.0.0 | 70,086 | 11/11/2025 |
| 9.10.0 | 35,054 | 10/14/2025 |
| 9.9.0 | 16,464 | 9/9/2025 |
| 9.8.0 | 17,102 | 8/12/2025 |
| 9.7.0 | 5,697 | 7/8/2025 |
| 9.6.0 | 27,055 | 6/10/2025 |
| 9.5.0 | 108,727 | 5/13/2025 |
| 9.4.0 | 11,685 | 4/8/2025 |
| 9.3.0 | 736 | 3/11/2025 |
| 9.2.0 | 80,197 | 2/11/2025 |
| 9.1.0 | 20,984 | 1/14/2025 |
| 9.0.0 | 6,010 | 11/12/2024 |
| 9.0.0-preview.9.24507.7 | 151 | 10/8/2024 |
| 9.0.0-preview.8.24460.1 | 127 | 9/10/2024 |
| 8.10.0 | 44,028 | 10/8/2024 |
| 8.9.1 | 20,235 | 9/6/2024 |
| 8.4.0 | 13,807 | 4/9/2024 |