Skip to content

Rename HttpLatencyTelemetry extensions class and drop redundant TFM guard - #7645

Merged
EasyL0ver merged 1 commit into
dotnet:mainfrom
EasyL0ver:users/pkudlacik/http-latency-enricher-followup
Jul 20, 2026
Merged

Rename HttpLatencyTelemetry extensions class and drop redundant TFM guard#7645
EasyL0ver merged 1 commit into
dotnet:mainfrom
EasyL0ver:users/pkudlacik/http-latency-enricher-followup

Conversation

@EasyL0ver

@EasyL0ver EasyL0ver commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #7602 addressing post-merge review feedback from @evgenyfedorov2.

  • Rename HttpLatencyTelemetryExtensionsHttpLatencyTelemetryServiceCollectionExtensions. Aligns with the *ServiceCollectionExtensions naming convention used by sibling extension classes in this library (RequestLatencyTelemetryServiceCollectionExtensions, HttpLoggingServiceCollectionExtensions, RequestHeadersEnricherServiceCollectionExtensions).
  • Remove the #if NET8_0_OR_GREATER guard from HttpLatencyLogEnricher and its extensions. The project only targets net8.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

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
@EasyL0ver
EasyL0ver requested a review from a team as a code owner July 20, 2026 13:39
Copilot AI review requested due to automatic review settings July 20, 2026 13:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 HttpLatencyTelemetryExtensions to HttpLatencyTelemetryServiceCollectionExtensions (and update the API baseline accordingly).
  • Remove #if NET8_0_OR_GREATER guards 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.

@EasyL0ver
EasyL0ver merged commit 13c6ff3 into dotnet:main Jul 20, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants