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
(there are others similar to this in AI default list itself, but potentially many more written by others)
Proposal is to add a new method (but hidden) in TelemetryClient called InitializeInstrumentationKey(ITelemetry telemetry), which can used by auto collection modules to populate instrumentation key. Once all auto collectors move to this method, the customer confusions about TelemetryInitializers being called multiple times is going to be mitigated. (along with the perf improvement!)
The text was updated successfully, but these errors were encountered:
TelemetryClient has Initialize() (https://github.com/Microsoft/ApplicationInsights-dotnet/blob/develop/src/Microsoft.ApplicationInsights/TelemetryClient.cs#L456) method, which is used by AutoCollection TelemetryModules (https://github.com/Microsoft/ApplicationInsights-dotnet/blob/develop/src/Microsoft.ApplicationInsights/TelemetryClient.cs#L456) to populate the instrumentation key from TelemetryClient.
This method causes all TelemetryInitializers to run. Apart from this, when Track() is eventually called, all TelemetryInitializers are run again.
While most TelemetryInitializers are written in such a way that it detects 'no action needed, exit quickly' - but there are exceptions.
An example is SyntheticUserAgentTelemetryInitializer, which, if called multiple times, will do all the compute-intensive task of checking useragent to the list of potential 'bot' strings.
https://github.com/Microsoft/ApplicationInsights-dotnet-server/blob/develop/Src/Web/Web.Shared.Net/SyntheticUserAgentTelemetryInitializer.cs#L50
(there are others similar to this in AI default list itself, but potentially many more written by others)
Proposal is to add a new method (but hidden) in TelemetryClient called
InitializeInstrumentationKey(ITelemetry telemetry)
, which can used by auto collection modules to populate instrumentation key. Once all auto collectors move to this method, the customer confusions about TelemetryInitializers being called multiple times is going to be mitigated. (along with the perf improvement!)The text was updated successfully, but these errors were encountered: