From ed7f1164f39ef08071cae8aa0deeada9a3d0255e Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Wed, 23 Sep 2020 13:02:16 -0500 Subject: [PATCH] =?UTF-8?q?fix(logging):=20=F0=9F=90=9B=F0=9F=9A=A7=20reve?= =?UTF-8?q?rt=20to=20InMemoryChannel=20to=20try=20fix=20AppInsights=20logg?= =?UTF-8?q?ing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 2 -- docker-compose.yml | 7 ------- .../appsettings.Development.json | 3 --- .../ConfigurationExtensions.cs | 10 ---------- .../Options/ApplicationInsightsOptions.cs | 9 --------- 5 files changed, 31 deletions(-) delete mode 100644 services/SharedKernel/FilterLists.SharedKernel.Logging/Options/ApplicationInsightsOptions.cs diff --git a/.env b/.env index 5d1c55132..c5b35f81f 100644 --- a/.env +++ b/.env @@ -1,5 +1,3 @@ -APPLICATION_INSIGHTS_SERVER_TELEMETRY_CHANNEL_STORAGE_PATH=application-insights - ARCHIVAL_APPLICATION_INSIGHTS_INSTRUMENTATION_KEY= ARCHIVAL_REDIS_CONNECTION_STRING=archival-scheduling-db:6379 ARCHIVAL_GIT_REPOSITORY_PATH=archives diff --git a/docker-compose.yml b/docker-compose.yml index b63b490fc..6947750ef 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -20,10 +20,8 @@ services: depends_on: - archival-scheduling-db volumes: - - archival-application-insights:/app/${APPLICATION_INSIGHTS_SERVER_TELEMETRY_CHANNEL_STORAGE_PATH} - archival-archives:/app/${ARCHIVAL_GIT_REPOSITORY_PATH} environment: - ApplicationInsights__ServerTelemetryChannelStoragePath: ${APPLICATION_INSIGHTS_SERVER_TELEMETRY_CHANNEL_STORAGE_PATH} ApplicationInsights__InstrumentationKey: ${ARCHIVAL_APPLICATION_INSIGHTS_INSTRUMENTATION_KEY} ConnectionStrings__SchedulingConnection: ${ARCHIVAL_REDIS_CONNECTION_STRING} Api__DirectoryHost: ${DIRECTORY_HOST} @@ -50,10 +48,7 @@ services: directory: depends_on: - directory-db - volumes: - - directory-application-insights:/app/${APPLICATION_INSIGHTS_SERVER_TELEMETRY_CHANNEL_STORAGE_PATH} environment: - ApplicationInsights__ServerTelemetryChannelStoragePath: ${APPLICATION_INSIGHTS_SERVER_TELEMETRY_CHANNEL_STORAGE_PATH} ApplicationInsights__InstrumentationKey: ${DIRECTORY_APPLICATION_INSIGHTS_INSTRUMENTATION_KEY} ConnectionStrings__DirectoryConnection: ${DIRECTORY_CONNECTION_STRING} @@ -75,8 +70,6 @@ networks: directory: volumes: - archival-application-insights: archival-scheduling-db: archival-archives: - directory-application-insights: directory-db: diff --git a/services/Directory/FilterLists.Directory.Api/appsettings.Development.json b/services/Directory/FilterLists.Directory.Api/appsettings.Development.json index d3fc623ea..281e60be0 100644 --- a/services/Directory/FilterLists.Directory.Api/appsettings.Development.json +++ b/services/Directory/FilterLists.Directory.Api/appsettings.Development.json @@ -1,8 +1,5 @@ { "_comment": "Used only for managing EF migrations. All other configuration is done via environment variables.", - "ApplicationInsights": { - "ServerTelemetryChannelStoragePath": "application-insights" - }, "ConnectionStrings": { "DirectoryConnection": "Server=directory-db;Database=filterlists;User Id=filterlists;Password=filterlists;" } diff --git a/services/SharedKernel/FilterLists.SharedKernel.Logging/ConfigurationExtensions.cs b/services/SharedKernel/FilterLists.SharedKernel.Logging/ConfigurationExtensions.cs index 76ab48a6e..37f3315c5 100644 --- a/services/SharedKernel/FilterLists.SharedKernel.Logging/ConfigurationExtensions.cs +++ b/services/SharedKernel/FilterLists.SharedKernel.Logging/ConfigurationExtensions.cs @@ -1,7 +1,4 @@ using System; -using FilterLists.SharedKernel.Logging.Options; -using Microsoft.ApplicationInsights.Channel; -using Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel; using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; @@ -21,13 +18,6 @@ public static void AddSharedKernelLogging(this IServiceCollection services, ICon { _ = configuration ?? throw new ArgumentNullException(nameof(configuration)); - using var serverTelemetryChannel = new ServerTelemetryChannel - { - StorageFolder = configuration.GetSection(ApplicationInsightsOptions.Key) - .Get() - .ServerTelemetryChannelStoragePath - }; - services.AddSingleton(typeof(ITelemetryChannel), serverTelemetryChannel); services.AddApplicationInsightsTelemetry(); } diff --git a/services/SharedKernel/FilterLists.SharedKernel.Logging/Options/ApplicationInsightsOptions.cs b/services/SharedKernel/FilterLists.SharedKernel.Logging/Options/ApplicationInsightsOptions.cs deleted file mode 100644 index 21a233811..000000000 --- a/services/SharedKernel/FilterLists.SharedKernel.Logging/Options/ApplicationInsightsOptions.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace FilterLists.SharedKernel.Logging.Options -{ - internal class ApplicationInsightsOptions - { - public const string Key = "ApplicationInsights"; - - public string ServerTelemetryChannelStoragePath { get; set; } = null!; - } -}