diff --git a/Backend/Otel/OtelKernel.cs b/Backend/Otel/OtelKernel.cs index b356134e67..c19161f81a 100644 --- a/Backend/Otel/OtelKernel.cs +++ b/Backend/Otel/OtelKernel.cs @@ -1,8 +1,5 @@ - -// using System; using System.Diagnostics; using BackendFramework.Interfaces; - using System.Diagnostics.CodeAnalysis; using Microsoft.Extensions.DependencyInjection; using OpenTelemetry; @@ -12,7 +9,6 @@ using OpenTelemetry.Resources; using OpenTelemetry.Trace; using System.Linq; -// using MongoDB.Driver.Core.Events; namespace BackendFramework.Otel { @@ -46,7 +42,7 @@ private static void AspNetCoreBuilder(AspNetCoreTraceInstrumentationOptions opti } else { - // activity.SetTag("sessionId", "NULL"); + activity.SetTag("sessionId", "NULL"); // activity.SetBaggage("sessionId", "NULL"); } }; @@ -69,7 +65,7 @@ private static void AspNetCoreBuilder(AspNetCoreTraceInstrumentationOptions opti } else { - // activity.SetTag("sessionId", "NULL"); + activity.SetTag("sessionId", "NULL"); // activity.SetBaggage("sessionId", "NULL"); } }; @@ -108,7 +104,7 @@ private static void HttpClientBuilder(HttpClientTraceInstrumentationOptions opti } else { - // activity.SetTag("sessionId", "NULL"); + activity.SetTag("sessionId", "NULL"); // activity.SetBaggage("sessionId", "NULL"); } }; @@ -143,31 +139,12 @@ public static void AddOpenTelemetryInstrumentation(this IServiceCollection servi .AddProcessor() .AddAspNetCoreInstrumentation(AspNetCoreBuilder) .AddHttpClientInstrumentation(HttpClientBuilder) - // .AddSource("MongoDB.Driver.Core.Extensions.DiagnosticSources") .AddConsoleExporter() .AddOtlpExporter() ); } - // private static void EnrichWithSession(this Activity activity, HttpContext httpContext) - // { - - // // in progress - - // string? sessionId = httpContext.Headers.TryGetValues("sessionId", out var values) ? values.FirstOrDefault() : null; - // if (sessionId != null) - // { - // activity.SetTag("SESSIONID HTTP RESPONSE", sessionId); - // } - // else - // { - // activity.SetTag("SESSIONID HTTP RESPONSE", "NULL"); - // } - - - // } - internal class LocationEnricher(ILocationProvider locationProvider) : BaseProcessor { public override async void OnEnd(Activity data)