If not supplied to the constructor the delegate AppInsightsCore class does not pick up the default channel (BreezeChannelIdentifier = "AppInsightsChannelPlugin") plugin configuration and therefore doesn't use the supplied XHR override.
This is subtle to notice when running in Node 18+ (VS Code 1.82+) since the AppInsights SDK mostly uses the fetch API which is available in Node and appears to work.
This is similar to the pattern used for the 1DS client which presumably doesn't have the same issue and is where I got the idea to try it. Except the 1DS SDK separates the constructor from an initialize method:
If not supplied to the constructor the delegate AppInsightsCore class does not pick up the default channel (
BreezeChannelIdentifier = "AppInsightsChannelPlugin"
) plugin configuration and therefore doesn't use the supplied XHR override.This is subtle to notice when running in Node 18+ (VS Code 1.82+) since the AppInsights SDK mostly uses the
fetch
API which is available in Node and appears to work.This is similar to the pattern used for the 1DS client which presumably doesn't have the same issue and is where I got the idea to try it. Except the 1DS SDK separates the constructor from an
initialize
method:https://github.com/microsoft/vscode-extension-telemetry/blob/3a87442dc26f80072f793ac8a1fc47bf0224c81a/src/common/1dsClientFactory.ts#L50