Added event counter instrumentation

- Added counters for ASP.NET Core hosting
pull/178/head
David Fowler 2022-11-05 14:58:25 -07:00
parent cefe919c67
commit 3e1fd4bd73
2 changed files with 7 additions and 2 deletions

View File

@ -26,7 +26,8 @@
<PackageReference Include="OpenTelemetry.Exporter.Jaeger" Version="1.4.0-beta.2" />
<PackageReference Include="OpenTelemetry.Exporter.Prometheus.AspNetCore" Version="1.4.0-beta.2" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.0.0-rc9.8" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.0.0-rc9.8" />
<PackageReference Include="OpenTelemetry.Instrumentation.EventCounters" Version="1.0.0-alpha.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.0.0-rc9.8" />
<PackageReference Include="OpenTelemetry.Instrumentation.EntityFrameworkCore" Version="1.0.0-beta.3" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.0.0-rc9.8" />
<PackageReference Include="OpenTelemetry.Instrumentation.Process" Version="0.1.0-alpha.1" />

View File

@ -97,7 +97,11 @@ builder.Services.AddOpenTelemetryMetrics(metrics =>
.AddHttpClientInstrumentation()
.AddRuntimeInstrumentation()
.AddProcessInstrumentation()
.AddHttpClientInstrumentation();
.AddHttpClientInstrumentation()
.AddEventCountersInstrumentation(ec =>
{
ec.AddEventSources("Microsoft.AspNetCore.Hosting");
});
});
builder.Logging.AddOpenTelemetry(logging =>