From df8825fa503a8333c9308e54abf7769d510596cc Mon Sep 17 00:00:00 2001 From: Are Almaas Date: Tue, 10 Dec 2024 15:03:17 +0100 Subject: [PATCH] yayyay --- .../AspNetUtilitiesExtensions.cs | 18 +----------------- .../AspNetUtilitiesSettings.cs | 17 +++++++++++++++++ .../Digdir.Library.Utils.AspNet.csproj | 1 + 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/Digdir.Library.Utils.AspNet/AspNetUtilitiesExtensions.cs b/src/Digdir.Library.Utils.AspNet/AspNetUtilitiesExtensions.cs index 0cbb181a9..1b5bdde14 100644 --- a/src/Digdir.Library.Utils.AspNet/AspNetUtilitiesExtensions.cs +++ b/src/Digdir.Library.Utils.AspNet/AspNetUtilitiesExtensions.cs @@ -142,6 +142,7 @@ public static WebApplicationBuilder ConfigureTelemetry( return true; }; }) + .AddEntityFrameworkCoreInstrumentation() .AddNpgsql() .AddFusionCacheInstrumentation(); }); @@ -165,20 +166,3 @@ public static WebApplicationBuilder ConfigureTelemetry( return builder; } } - -public class TelemetrySettings -{ - private const string MassTransitSource = "MassTransit"; - private const string AzureSource = "Azure.*"; - - public string? ServiceName { get; set; } - public string? Endpoint { get; set; } - public string? Protocol { get; set; } - public string? AppInsightsConnectionString { get; set; } - public string? ResourceAttributes { get; set; } - public HashSet TraceSources { get; set; } = new() - { - AzureSource, - MassTransitSource - }; -} diff --git a/src/Digdir.Library.Utils.AspNet/AspNetUtilitiesSettings.cs b/src/Digdir.Library.Utils.AspNet/AspNetUtilitiesSettings.cs index f8e2f7fdb..e6b10c2e1 100644 --- a/src/Digdir.Library.Utils.AspNet/AspNetUtilitiesSettings.cs +++ b/src/Digdir.Library.Utils.AspNet/AspNetUtilitiesSettings.cs @@ -9,3 +9,20 @@ public sealed class HealthCheckSettings { public List HttpGetEndpointsToCheck { get; set; } = []; } + +public sealed class TelemetrySettings +{ + private const string MassTransitSource = "MassTransit"; + private const string AzureSource = "Azure.*"; + + public string? ServiceName { get; set; } + public string? Endpoint { get; set; } + public string? Protocol { get; set; } + public string? AppInsightsConnectionString { get; set; } + public string? ResourceAttributes { get; set; } + public HashSet TraceSources { get; set; } = new() + { + AzureSource, + MassTransitSource + }; +} \ No newline at end of file diff --git a/src/Digdir.Library.Utils.AspNet/Digdir.Library.Utils.AspNet.csproj b/src/Digdir.Library.Utils.AspNet/Digdir.Library.Utils.AspNet.csproj index 04d08205b..bb5a6ba2a 100644 --- a/src/Digdir.Library.Utils.AspNet/Digdir.Library.Utils.AspNet.csproj +++ b/src/Digdir.Library.Utils.AspNet/Digdir.Library.Utils.AspNet.csproj @@ -12,6 +12,7 @@ +