Sitelet https://github.com/Microsoft/ApplicationInsights-aspnetcore/issues/634
Skip to content
This repository was archived by the owner on Jun 10, 2020. It is now read-only.
This repository was archived by the owner on Jun 10, 2020. It is now read-only.

Make Module configuration easy #634

Description

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);
}
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions