You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 10, 2020. It is now read-only.
Provide an ability to configure any TelemetryModule in an easy way as opposed to the following documented way.
Configuring Telemetry Module Services
Inorder to configure any properties of TelemetyModules, obtain the module from DI Container first. Then modify the required properties, and re-initialize the module with currently active Telemetry Configuration.
For eg:, to modify DependencyTrackingTelemetryModule to disable setting Correlationheaders, the following code is required in the Configure method of you Startup class.
DependencyTrackingTelemetryModule dep;
var modules = app.ApplicationServices.GetServices();
foreach(var module in modules)
{
if (module is DependencyTrackingTelemetryModule)
{
dep = module as DependencyTrackingTelemetryModule;
dep.SetComponentCorrelationHttpHeaders = false;
dep.Initialize(TelemetryConfiguration.Active);
}
}
The text was updated successfully, but these errors were encountered:
To configure a telemetry module, use the extension method ConfigureTelemetryModule<T>(Action <T> configModule) on IServiceCollection. This should be done in the ConfigureServices() method of Application's Startup.cs class.
For example, the following shows how to configure DependencyTrackingTelemetryModule
Provide an ability to configure any TelemetryModule in an easy way as opposed to the following documented way.
Configuring Telemetry Module Services
Inorder to configure any properties of TelemetyModules, obtain the module from DI Container first. Then modify the required properties, and re-initialize the module with currently active Telemetry Configuration.
For eg:, to modify DependencyTrackingTelemetryModule to disable setting Correlationheaders, the following code is required in the Configure method of you Startup class.
DependencyTrackingTelemetryModule dep;
var modules = app.ApplicationServices.GetServices();
foreach(var module in modules)
{
if (module is DependencyTrackingTelemetryModule)
{
dep = module as DependencyTrackingTelemetryModule;
dep.SetComponentCorrelationHttpHeaders = false;
dep.Initialize(TelemetryConfiguration.Active);
}
}
The text was updated successfully, but these errors were encountered: