add units to http metrics (#90020)
authorAnton Firszov <antonfir@gmail.com>
Mon, 7 Aug 2023 22:39:59 +0000 (00:39 +0200)
committerGitHub <noreply@github.com>
Mon, 7 Aug 2023 22:39:59 +0000 (15:39 -0700)
src/libraries/System.Net.Http/src/System/Net/Http/Metrics/MetricsHandler.cs
src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/Metrics/SocketsHttpHandlerMetrics.cs

index bf92139..7137d65 100644 (file)
@@ -24,6 +24,7 @@ namespace System.Net.Http.Metrics
             // Meter has a cache for the instruments it owns
             _activeRequests = meter.CreateUpDownCounter<long>(
                 "http.client.active_requests",
+                unit: "{request}",
                 description: "Number of outbound HTTP requests that are currently active on the client.");
             _requestsDuration = meter.CreateHistogram<double>(
                 "http.client.request.duration",
index e560435..bd37b3f 100644 (file)
@@ -10,6 +10,7 @@ namespace System.Net.Http.Metrics
     {
         public readonly UpDownCounter<long> OpenConnections = meter.CreateUpDownCounter<long>(
             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<double> ConnectionDuration = meter.CreateHistogram<double>(