From 3ac6e1300ad7189d8e2215d900bcc860318b29b2 Mon Sep 17 00:00:00 2001 From: "agile.zhou" Date: Sat, 18 May 2024 17:20:58 +0800 Subject: [PATCH] Support Npg traces --- .../AgileConfig.Server.Apisite.csproj | 1 + src/AgileConfig.Server.Apisite/StartupExtension.cs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/AgileConfig.Server.Apisite/AgileConfig.Server.Apisite.csproj b/src/AgileConfig.Server.Apisite/AgileConfig.Server.Apisite.csproj index ef94a2c8..7c1a8e38 100644 --- a/src/AgileConfig.Server.Apisite/AgileConfig.Server.Apisite.csproj +++ b/src/AgileConfig.Server.Apisite/AgileConfig.Server.Apisite.csproj @@ -31,6 +31,7 @@ + diff --git a/src/AgileConfig.Server.Apisite/StartupExtension.cs b/src/AgileConfig.Server.Apisite/StartupExtension.cs index cf10152b..01c06381 100644 --- a/src/AgileConfig.Server.Apisite/StartupExtension.cs +++ b/src/AgileConfig.Server.Apisite/StartupExtension.cs @@ -1,12 +1,12 @@ using AgileConfig.Server.Common; using Microsoft.Extensions.DependencyInjection; using OpenTelemetry.Metrics; -using OpenTelemetry.Resources; using System.Net.Http; using OpenTelemetry.Trace; using OpenTelemetry.Logs; using OpenTelemetry.Exporter; using OpenTelemetry; +using Npgsql; namespace AgileConfig.Server.Apisite { @@ -31,7 +31,7 @@ public static IOpenTelemetryBuilder AddOtlpTraces(this IOpenTelemetryBuilder bui builder.WithTracing(tracing => tracing .AddAspNetCoreInstrumentation() - .AddHttpClientInstrumentation() + .AddNpgsql() .AddOtlpExporter(op => { op.Protocol = Appsettings.OtlpTracesProtocol == "http" ? OtlpExportProtocol.HttpProtobuf : OtlpExportProtocol.Grpc;