From e857642fd03f8a6acdf42af7d9a814e320ec8432 Mon Sep 17 00:00:00 2001 From: Anton Firszov Date: Tue, 8 Aug 2023 00:39:59 +0200 Subject: [PATCH] add units to http metrics (#90020) --- .../src/System/Net/Http/Metrics/MetricsHandler.cs | 1 + .../Http/SocketsHttpHandler/Metrics/SocketsHttpHandlerMetrics.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/Metrics/MetricsHandler.cs b/src/libraries/System.Net.Http/src/System/Net/Http/Metrics/MetricsHandler.cs index bf92139284f57..7137d654e6f00 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/Metrics/MetricsHandler.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/Metrics/MetricsHandler.cs @@ -24,6 +24,7 @@ public MetricsHandler(HttpMessageHandler innerHandler, IMeterFactory? meterFacto // Meter has a cache for the instruments it owns _activeRequests = meter.CreateUpDownCounter( "http.client.active_requests", + unit: "{request}", description: "Number of outbound HTTP requests that are currently active on the client."); _requestsDuration = meter.CreateHistogram( "http.client.request.duration", diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Metrics/SocketsHttpHandlerMetrics.cs b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Metrics/SocketsHttpHandlerMetrics.cs index e560435cf48a0..bd37b3f66b805 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Metrics/SocketsHttpHandlerMetrics.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Metrics/SocketsHttpHandlerMetrics.cs @@ -10,6 +10,7 @@ internal sealed class SocketsHttpHandlerMetrics(Meter meter) { public readonly UpDownCounter OpenConnections = meter.CreateUpDownCounter( name: "http.client.open_connections", + unit: "{connection}", description: "Number of outbound HTTP connections that are currently active or idle on the client."); public readonly Histogram ConnectionDuration = meter.CreateHistogram(