OP changes

This commit is contained in:
Roland Fieger
2021-10-12 11:22:16 +02:00
parent fdc816624e
commit 66f8d19f67
2 changed files with 4 additions and 1 deletions

View File

@@ -10,6 +10,7 @@
<PackageReference Include="Elastic.Apm.NetCoreAll" Version="1.11.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.1.16" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="OpenTelemetry.Contrib.Instrumentation.EntityFrameworkCore" Version="1.0.0-beta2" />
<PackageReference Include="OpenTelemetry.Exporter.Console" Version="1.1.0" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.1.0" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.0.0-rc7" />

View File

@@ -52,8 +52,10 @@ namespace FwSearchApi
services.AddSwaggerGen();
services.AddOpenTelemetryTracing((builder) => builder
//.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("TxSearchApi"))
.AddAspNetCoreInstrumentation()
.AddHttpClientInstrumentation()
.AddEntityFrameworkCoreInstrumentation()
.AddConsoleExporter()
.AddOtlpExporter(otlpOptions => {
otlpOptions.Endpoint = new Uri("http://192.168.178.44:8200");
@@ -73,7 +75,7 @@ namespace FwSearchApi
app.UseSwagger();
app.UseElasticApm(_configuration, new EfCoreDiagnosticsSubscriber());
//app.UseElasticApm(_configuration, new EfCoreDiagnosticsSubscriber());
app.UseSwaggerUI(c =>
{