chore: add http telemetry support

This commit is contained in:
Timothy Schenk 2023-11-20 14:29:04 +01:00 committed by rainote
parent 4823c352dc
commit 45b13be4a7
2 changed files with 7 additions and 1 deletions

View file

@ -46,8 +46,13 @@ builder.Services.AddOpenTelemetry()
tracing.SetSampler(new AlwaysOnSampler());
tracing.AddMassTransitInstrumentation();
tracing.AddEntityFrameworkCoreInstrumentation(options => options.SetDbStatementForText = true);
tracing.AddHttpClientInstrumentation();
})
.WithMetrics(metrics => { metrics.AddRuntimeInstrumentation(); });
.WithMetrics(metrics =>
{
metrics.AddRuntimeInstrumentation();
metrics.AddHttpClientInstrumentation();
});
builder.Logging.AddOpenTelemetry(logging =>
{

View file

@ -94,6 +94,7 @@
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.7.0-alpha.1" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.7.0-alpha.1" />
<PackageReference Include="OpenTelemetry.Instrumentation.EntityFrameworkCore" Version="1.0.0-beta.8" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.6.0-beta.3" />
<PackageReference Include="OpenTelemetry.Instrumentation.MassTransit" Version="1.0.0-beta.3" />
<PackageReference Include="OpenTelemetry.Instrumentation.Runtime" Version="1.5.1" />
<PackageReference Include="OpenTelemetry.PersistentStorage.FileSystem" Version="1.0.0" />