From d15b1f8045e6a1f597424104efc1c15587ea4f9b Mon Sep 17 00:00:00 2001 From: Timothy Schenk Date: Wed, 22 Nov 2023 06:28:01 +0100 Subject: [PATCH] chore: some adjustments to tracing --- Server/Program.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Server/Program.cs b/Server/Program.cs index 06eb989..212fc75 100644 --- a/Server/Program.cs +++ b/Server/Program.cs @@ -24,6 +24,8 @@ var builder = Host.CreateApplicationBuilder(); builder.Environment.EnvironmentName = "Development"; #endif +builder.Services.AddMetrics(); + builder.Configuration.AddJsonFile("settings.json", true, true) .AddJsonFile($"settings.{builder.Environment.EnvironmentName}.json", true) .AddEnvironmentVariables().Build(); @@ -47,16 +49,13 @@ if (configuration.GetValue("Tracing:Enabled")) .WithTracing(tracing => { tracing.AddSource(nameof(Server)); - tracing.SetSampler(new AlwaysOnSampler()); - tracing.AddMassTransitInstrumentation(); + //tracing.AddSource("MassTransit"); tracing.AddEntityFrameworkCoreInstrumentation(options => options.SetDbStatementForText = true); - tracing.AddHttpClientInstrumentation(); tracing.AddNpgsql(); }) .WithMetrics(metrics => { metrics.AddRuntimeInstrumentation(); - metrics.AddHttpClientInstrumentation(); }); builder.Logging.AddOpenTelemetry(logging =>