Revert "Revert "fix(logging): 🐛🚧 revert to InMemoryChannel to try fix AppInsights logging""

This reverts commit 690d1791e1.
This commit is contained in:
Collin M. Barrett 2020-09-23 17:04:50 -05:00
parent 690d1791e1
commit 6452f7e965
5 changed files with 0 additions and 31 deletions

2
.env
View file

@ -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

View file

@ -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:

View file

@ -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;"
}

View file

@ -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<ApplicationInsightsOptions>()
.ServerTelemetryChannelStoragePath
};
services.AddSingleton(typeof(ITelemetryChannel), serverTelemetryChannel);
services.AddApplicationInsightsTelemetry();
}

View file

@ -1,9 +0,0 @@
namespace FilterLists.SharedKernel.Logging.Options
{
internal class ApplicationInsightsOptions
{
public const string Key = "ApplicationInsights";
public string ServerTelemetryChannelStoragePath { get; set; } = null!;
}
}