Rename HttpLatencyTelemetry extensions class and drop redundant TFM guard - #7645
Merged
EasyL0ver merged 1 commit intoJul 20, 2026
Conversation
Address post-merge review feedback on dotnet#7602: - Rename HttpLatencyTelemetryExtensions to HttpLatencyTelemetryServiceCollectionExtensions to match the *ServiceCollectionExtensions naming convention used by sibling extension classes (RequestLatencyTelemetryServiceCollectionExtensions, HttpLoggingServiceCollectionExtensions). - Remove the always-true #if NET8_0_OR_GREATER guard from the enricher and its extensions. The project only targets net8.0+, so the guard never excluded any target framework. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: d705cd71-1bda-4572-88e7-0bbfda83c3d6
Contributor
There was a problem hiding this comment.
Pull request overview
This PR is a follow-up cleanup to the experimental HTTP latency telemetry enricher added in #7602, aligning the public extension-class naming with the existing *ServiceCollectionExtensions convention and removing a redundant target-framework guard that no longer applies (project targets net8.0+ only).
Changes:
- Rename the public extensions type
HttpLatencyTelemetryExtensionstoHttpLatencyTelemetryServiceCollectionExtensions(and update the API baseline accordingly). - Remove
#if NET8_0_OR_GREATERguards from the latency enricher and extension class files (dead code given TFMs). - Update the corresponding unit test class and references to the renamed type.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| test/Libraries/Microsoft.AspNetCore.Diagnostics.Middleware.Tests/Latency/HttpLatencyTelemetryServiceCollectionExtensionsTests.cs | Updates test class name and references to the renamed extensions type. |
| src/Libraries/Microsoft.AspNetCore.Diagnostics.Middleware/Microsoft.AspNetCore.Diagnostics.Middleware.json | Updates API baseline to reflect the renamed public type and member signature owner. |
| src/Libraries/Microsoft.AspNetCore.Diagnostics.Middleware/Latency/Internal/HttpLatencyLogEnricher.cs | Removes redundant NET8_0_OR_GREATER conditional compilation guard. |
| src/Libraries/Microsoft.AspNetCore.Diagnostics.Middleware/Latency/HttpLatencyTelemetryServiceCollectionExtensions.cs | Renames the public extensions class and removes redundant TFM guard. |
evgenyfedorov2
approved these changes
Jul 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #7602 addressing post-merge review feedback from @evgenyfedorov2.
HttpLatencyTelemetryExtensions→HttpLatencyTelemetryServiceCollectionExtensions. Aligns with the*ServiceCollectionExtensionsnaming convention used by sibling extension classes in this library (RequestLatencyTelemetryServiceCollectionExtensions,HttpLoggingServiceCollectionExtensions,RequestHeadersEnricherServiceCollectionExtensions).#if NET8_0_OR_GREATERguard fromHttpLatencyLogEnricherand its extensions. The project only targetsnet8.0+ (NetCoreTargetFrameworks= net8/net9/net10), so the guard never excluded any target framework — it was dead/misleading.The type is still
[Experimental], so this is not a breaking public API change. API baseline updated accordingly.Microsoft Reviewers: Open in CodeFlow