Skip to content
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.
/ ServerCommon Public archive

Commit

Permalink
Ensure all TelemetryModules are initialized from applicationinsights.…
Browse files Browse the repository at this point in the history
…config (#325)
  • Loading branch information
xavierdecoster authored Dec 20, 2019
1 parent abbf45b commit f9bff5a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/NuGet.Services.Logging/ApplicationInsights.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Microsoft.ApplicationInsights;
using Microsoft.ApplicationInsights.DataContracts;
using Microsoft.ApplicationInsights.Extensibility;
using Microsoft.ApplicationInsights.Extensibility.Implementation;
using Microsoft.ApplicationInsights.Extensibility.Implementation.Tracing;

namespace NuGet.Services.Logging
Expand Down Expand Up @@ -65,6 +66,13 @@ private static ApplicationInsightsConfiguration InitializeApplicationInsightsCon

telemetryConfiguration.TelemetryInitializers.Add(new TelemetryContextInitializer());

// Hook-up the TelemetryModules configured in applicationinsights.config into our own
// TelemetryConfiguration instance, as this doesn't happen automatically...
foreach (var telemetryModule in TelemetryModules.Instance.Modules)
{
telemetryModule.Initialize(telemetryConfiguration);
}

// Construct a TelemetryClient to emit traces so we can track and debug AI initialization.
var telemetryClient = new TelemetryClient(telemetryConfiguration);

Expand Down

0 comments on commit f9bff5a

Please sign in to comment.