From fd3125ac8025c32c7530103a623a7efb091b8499 Mon Sep 17 00:00:00 2001 From: Anders Abel Date: Tue, 16 Apr 2024 10:52:32 +0200 Subject: [PATCH 1/2] Fix identation --- hosts/main/HostingExtensions.cs | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/hosts/main/HostingExtensions.cs b/hosts/main/HostingExtensions.cs index c42d0c0d7..784299665 100644 --- a/hosts/main/HostingExtensions.cs +++ b/hosts/main/HostingExtensions.cs @@ -42,24 +42,24 @@ internal static WebApplication ConfigureServices(this WebApplicationBuilder buil return Task.FromResult(principal); }); -var openTelemetry = builder.Services.AddOpenTelemetry(); + var openTelemetry = builder.Services.AddOpenTelemetry(); -openTelemetry.ConfigureResource(r => r - .AddService(builder.Environment.ApplicationName)); + openTelemetry.ConfigureResource(r => r + .AddService(builder.Environment.ApplicationName)); -openTelemetry.WithMetrics(m => m - .AddMeter(Telemetry.ServiceName) - .AddMeter(Pages.Telemetry.ServiceName) - .AddPrometheusExporter()); + openTelemetry.WithMetrics(m => m + .AddMeter(Telemetry.ServiceName) + .AddMeter(Pages.Telemetry.ServiceName) + .AddPrometheusExporter()); -openTelemetry.WithTracing(t => t - .AddSource(IdentityServerConstants.Tracing.Basic) - .AddSource(IdentityServerConstants.Tracing.Cache) - .AddSource(IdentityServerConstants.Tracing.Services) - .AddSource(IdentityServerConstants.Tracing.Stores) - .AddSource(IdentityServerConstants.Tracing.Validation) - .AddAspNetCoreInstrumentation() - .AddConsoleExporter()); + openTelemetry.WithTracing(t => t + .AddSource(IdentityServerConstants.Tracing.Basic) + .AddSource(IdentityServerConstants.Tracing.Cache) + .AddSource(IdentityServerConstants.Tracing.Services) + .AddSource(IdentityServerConstants.Tracing.Stores) + .AddSource(IdentityServerConstants.Tracing.Validation) + .AddAspNetCoreInstrumentation() + .AddConsoleExporter()); return builder.Build(); } @@ -150,7 +150,7 @@ internal static WebApplication ConfigurePipeline(this WebApplication app) // health checks app.MapHealthChecks("/health"); - + // local API endpoints app.MapControllers() .RequireAuthorization(IdentityServerConstants.LocalApi.PolicyName); From b63a218d1d9df7b2a26d29204f2bc81e443e48bb Mon Sep 17 00:00:00 2001 From: Anders Abel Date: Wed, 8 May 2024 12:42:15 +0200 Subject: [PATCH 2/2] Comment out tracing from the host - It fills up the console, not suitable to have enabled by default --- hosts/main/HostingExtensions.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/hosts/main/HostingExtensions.cs b/hosts/main/HostingExtensions.cs index 784299665..051a69024 100644 --- a/hosts/main/HostingExtensions.cs +++ b/hosts/main/HostingExtensions.cs @@ -52,14 +52,14 @@ internal static WebApplication ConfigureServices(this WebApplicationBuilder buil .AddMeter(Pages.Telemetry.ServiceName) .AddPrometheusExporter()); - openTelemetry.WithTracing(t => t - .AddSource(IdentityServerConstants.Tracing.Basic) - .AddSource(IdentityServerConstants.Tracing.Cache) - .AddSource(IdentityServerConstants.Tracing.Services) - .AddSource(IdentityServerConstants.Tracing.Stores) - .AddSource(IdentityServerConstants.Tracing.Validation) - .AddAspNetCoreInstrumentation() - .AddConsoleExporter()); + //openTelemetry.WithTracing(t => t + // .AddSource(IdentityServerConstants.Tracing.Basic) + // .AddSource(IdentityServerConstants.Tracing.Cache) + // .AddSource(IdentityServerConstants.Tracing.Services) + // .AddSource(IdentityServerConstants.Tracing.Stores) + // .AddSource(IdentityServerConstants.Tracing.Validation) + // .AddAspNetCoreInstrumentation() + // .AddConsoleExporter()); return builder.Build(); }