@Mikhail-Pranovich identified performance issues in RequestTrackingTelemetryModule.
Specifically:
-
Setting the requestTelemetry.Url from the context
https://github.com/Microsoft/ApplicationInsights-dotnet-server/blob/3bee86d3f7ec3e81efe6c5ad3ebdbe37f79929bb/Src/Web/Web.Shared.Net/RequestTrackingTelemetryModule.cs#L164-L167
-
Setting the requestTelemetry.Source to the SourceAppId
https://github.com/Microsoft/ApplicationInsights-dotnet-server/blob/3bee86d3f7ec3e81efe6c5ad3ebdbe37f79929bb/Src/Web/Web.Shared.Net/RequestTrackingTelemetryModule.cs#L176-L203
Proposal
I'm proposing a feature flag to make this an opt-in feature:
- A new property:
RequestTrackingTelemetryModule.DisableTrackingProperties (open to naming suggestions)
https://github.com/Microsoft/ApplicationInsights-dotnet-server/blob/944ee584e39b79b6707479cc3762e5077f97b8e5/Src/Web/Web.Shared.Net/RequestTrackingTelemetryModule.cs#L56-L64
This would disable setting this properties in the RequestTrackingTelemetryModule.
- Settings these properties would be deferred to a TelemetryProcessor:
https://github.com/Microsoft/ApplicationInsights-dotnet-server/blob/f145561f564ce3094115c5588920fc7eef0f8466/Src/Web/Web.Shared.Net/Extensibility/Implementation/PostSamplingTelemetryProcessor.cs#L12-L17
Risks
Cijo Thomas (@cijothomas) had a good comment:
URL is already populated by RequestCollectionModules which is shipped officially.
Modifying existing RequestCollectionModules to NOT populate URL, and instead rely on this new TP is a behavior change- Tel.Initializers will not see the URL. And also any TP added before this TP wont see URL. And there is no guarantee that TP is run in same context as incoming Request, so HttpContext.Current could be null.
We can discuss such change, but i'd do it only when we are changing major version.
Open Question
- I'm looking for a compromise. What changes would be required to contribute this change to the official SDK?
- Attach wants these changes already, and cannot wait for 3.0
@Mikhail-Pranovich identified performance issues in RequestTrackingTelemetryModule.
Specifically:
Setting the
requestTelemetry.Urlfrom the contexthttps://github.com/Microsoft/ApplicationInsights-dotnet-server/blob/3bee86d3f7ec3e81efe6c5ad3ebdbe37f79929bb/Src/Web/Web.Shared.Net/RequestTrackingTelemetryModule.cs#L164-L167
Setting the
requestTelemetry.Sourceto the SourceAppIdhttps://github.com/Microsoft/ApplicationInsights-dotnet-server/blob/3bee86d3f7ec3e81efe6c5ad3ebdbe37f79929bb/Src/Web/Web.Shared.Net/RequestTrackingTelemetryModule.cs#L176-L203
Proposal
I'm proposing a feature flag to make this an opt-in feature:
RequestTrackingTelemetryModule.DisableTrackingProperties(open to naming suggestions)https://github.com/Microsoft/ApplicationInsights-dotnet-server/blob/944ee584e39b79b6707479cc3762e5077f97b8e5/Src/Web/Web.Shared.Net/RequestTrackingTelemetryModule.cs#L56-L64
This would disable setting this properties in the RequestTrackingTelemetryModule.
https://github.com/Microsoft/ApplicationInsights-dotnet-server/blob/f145561f564ce3094115c5588920fc7eef0f8466/Src/Web/Web.Shared.Net/Extensibility/Implementation/PostSamplingTelemetryProcessor.cs#L12-L17
Risks
Cijo Thomas (@cijothomas) had a good comment:
Open Question