From 9bf335546f3a7b3ed7d2878f6ce6d78899f47ac6 Mon Sep 17 00:00:00 2001 From: Andra Constantin Date: Tue, 24 Sep 2024 10:22:08 -0400 Subject: [PATCH] clean Kernel --- Backend/Otel/OtelKernel.cs | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/Backend/Otel/OtelKernel.cs b/Backend/Otel/OtelKernel.cs index fe8e539b6a..36ddd5bab2 100644 --- a/Backend/Otel/OtelKernel.cs +++ b/Backend/Otel/OtelKernel.cs @@ -24,13 +24,6 @@ public static class OtelKernel { public const string SourceName = "Backend-Otel"; - // private readonly LocationCache _locationCache; - - // public OtelKernel(LocationCache locationCache, IServiceCollection serviceCollection) - // { - // _locationCache = locationCache; - // AddOpenTelemetryInstrumentation(serviceCollection); - // } [ExcludeFromCodeCoverage] private static void AspNetCoreBuilder(AspNetCoreTraceInstrumentationOptions options) @@ -89,8 +82,6 @@ private static void HttpClientBuilder(HttpClientTraceInstrumentationOptions opti { activity.SetTag("outbound.http.response.body.size", "no content"); } - - // await GetLocation(activity); }; options.EnrichWithHttpResponseMessage = (activity, response) => { @@ -105,7 +96,6 @@ private static void HttpClientBuilder(HttpClientTraceInstrumentationOptions opti public static void AddOpenTelemetryInstrumentation(this IServiceCollection services) { var appResourceBuilder = ResourceBuilder.CreateDefault(); - // var appResourceBuilder = ResourceBuilder.CreateDefault().AddService(ServiceName); // todo: include version services.AddOpenTelemetry().WithTracing(tracerProviderBuilder => tracerProviderBuilder .SetResourceBuilder(appResourceBuilder) @@ -118,19 +108,6 @@ public static void AddOpenTelemetryInstrumentation(this IServiceCollection servi .AddOtlpExporter() ); - // var meter = new Meter(ServiceName); - // // var counter = meter.CreateCounter("words-created"); - // services.AddOpenTelemetry().WithMetrics(metricProviderBuilder => metricProviderBuilder - // .SetResourceBuilder(appResourceBuilder) - // .AddMeter(meter.Name) - // .AddAspNetCoreInstrumentation() - // .AddHttpClientInstrumentation() - // .AddConsoleExporter() - // .AddOtlpExporter() - // ); - - // var meter = new Meter(ServiceName); - } // private static void EnrichWithUser(this Activity activity, HttpContext httpContext)