diff --git a/docker-compose.yml b/docker-compose.yml index 505a78c1e..d6effee06 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,6 +19,8 @@ services: depends_on: - archival-scheduling-db - directory-api + volumes: + - archival-application-insights:/app/application-insights environment: ApplicationInsights__InstrumentationKey: ${ARCHIVAL_APPLICATION_INSIGHTS_INSTRUMENTATION_KEY} ConnectionStrings__SchedulingConnection: ${ARCHIVAL_REDIS_CONNECTION_STRING} @@ -40,6 +42,8 @@ services: - directory depends_on: - directory-db + volumes: + - directory-application-insights:/app/application-insights environment: ApplicationInsights__InstrumentationKey: ${DIRECTORY_APPLICATION_INSIGHTS_INSTRUMENTATION_KEY} ConnectionStrings__DirectoryConnection: ${DIRECTORY_CONNECTION_STRING} @@ -62,5 +66,7 @@ networks: directory: volumes: + archival-application-insights: archival-scheduling-db: + directory-application-insights: directory-db: diff --git a/services/SharedKernel/FilterLists.SharedKernel.Logging/ConfigurationExtensions.cs b/services/SharedKernel/FilterLists.SharedKernel.Logging/ConfigurationExtensions.cs index f04f3e505..b3bdc9662 100644 --- a/services/SharedKernel/FilterLists.SharedKernel.Logging/ConfigurationExtensions.cs +++ b/services/SharedKernel/FilterLists.SharedKernel.Logging/ConfigurationExtensions.cs @@ -1,4 +1,6 @@ -using Microsoft.AspNetCore.Builder; +using Microsoft.ApplicationInsights.Channel; +using Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel; +using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Serilog; @@ -14,6 +16,8 @@ public static IHostBuilder UseLogging(this IHostBuilder hostBuilder) public static void AddSharedKernelLogging(this IServiceCollection services) { + using var serverTelemetryChannel = new ServerTelemetryChannel {StorageFolder = "application-insights"}; + services.AddSingleton(typeof(ITelemetryChannel), serverTelemetryChannel); services.AddApplicationInsightsTelemetry(); }