Skip to content

Conversation

rainsxng
Copy link
Contributor

@rainsxng rainsxng commented Sep 9, 2025

Microsoft Reviewers: Open in CodeFlow

@rainsxng rainsxng marked this pull request as ready for review September 17, 2025 13:36
@rainsxng rainsxng requested a review from a team as a code owner September 17, 2025 13:36
@Copilot Copilot AI review requested due to automatic review settings September 17, 2025 13:36
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request introduces a new HttpLatencyMediator object to enhance HTTP client latency telemetry by adding measures and tags recording capabilities. The mediator provides a centralized way to record GC pause time measurements and HTTP version tags during HTTP request processing.

Key changes:

  • Adds HttpLatencyMediator class with platform-specific implementations for .NET and .NET Framework
  • Introduces HttpMeasures and HttpTags classes to define metric names and tag names
  • Updates the log enricher to include tags and measures in the output format with versioned schema

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
HttpLatencyMediator.cs New mediator class for .NET that records GC pause time measures and HTTP version tags
HttpLatencyMediator.netfx.cs .NET Framework version of the mediator with limited functionality (tags only)
HttpMeasures.cs Defines HTTP-related measure names including GC pause time
HttpTags.cs Defines HTTP-related tag names including HTTP version
HttpLatencyTelemetryHandler.cs Updated to accept and use the mediator for recording start metrics
HttpClientLatencyLogEnricher.cs Enhanced to use mediator and include tags/measures in enriched log output
HttpClientLatencyTelemetryExtensions.cs Registers the mediator and measure/tag names with DI container
Test files Updated to include mediator parameter in constructor calls and added comprehensive tests

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@evgenyfedorov2
Copy link
Member

@evgenyfedorov2
Copy link
Member

LGTM
@ananthsr could you please review this as SME?

# Conflicts:
#	src/Libraries/Microsoft.Extensions.Http.Diagnostics/Latency/Internal/HttpRequestLatencyListener.cs
@evgenyfedorov2 evgenyfedorov2 merged commit c4e57fb into main Sep 25, 2025
6 checks passed
@evgenyfedorov2 evgenyfedorov2 deleted the dbohdanov/measures-and-tags branch September 25, 2025 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants