mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
feat(logging): ✨ configure Application Insights ServerTelemetryChannel directory
This commit is contained in:
parent
e901699a6b
commit
0acdaa1b5c
2 changed files with 11 additions and 1 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue