Skip to content

Commit b6dcfe8

Browse files
authored
Example app to enable httpclient metrics instrumentation (#2955)
1 parent 6981795 commit b6dcfe8

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

examples/AspNetCore/Startup.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ public void ConfigureServices(IServiceCollection services)
124124
services.AddOpenTelemetryMetrics(builder =>
125125
{
126126
builder.AddAspNetCoreInstrumentation();
127+
builder.AddHttpClientInstrumentation();
127128

128129
switch (metricsExporter)
129130
{

src/OpenTelemetry.Instrumentation.Http/Implementation/HttpHandlerMetricsDiagnosticListener.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ internal class HttpHandlerMetricsDiagnosticListener : ListenerHandler
3030
public HttpHandlerMetricsDiagnosticListener(string name, Meter meter)
3131
: base(name)
3232
{
33-
this.httpClientDuration = meter.CreateHistogram<double>("http.client.duration", "milliseconds", "measure the duration of the outbound HTTP request");
33+
this.httpClientDuration = meter.CreateHistogram<double>("http.client.duration", "ms", "measures the duration of the outbound HTTP request");
3434
}
3535

3636
public override void OnStopActivity(Activity activity, object payload)

0 commit comments

Comments
 (0)