diff --git a/src/browser/telemetryReporter.ts b/src/browser/telemetryReporter.ts index 5832435..480c3ec 100644 --- a/src/browser/telemetryReporter.ts +++ b/src/browser/telemetryReporter.ts @@ -22,7 +22,7 @@ function getBrowserRelease(navigator: Navigator): string { export default class TelemetryReporter extends BaseTelemetryReporter { constructor(connectionString: string, replacementOptions?: ReplacementOption[]) { - let clientFactory = (connectionString: string) => appInsightsClientFactory(connectionString, vscode.env.machineId, undefined, replacementOptions); + let clientFactory = (connectionString: string) => appInsightsClientFactory(connectionString, vscode.env.machineId, vscode.env.sessionId, undefined, replacementOptions); // If key is usable by 1DS use the 1DS SDk if (TelemetryUtil.shouldUseOneDataSystemSDK(connectionString)) { clientFactory = (key: string) => oneDataSystemClientFactory(key, vscode); diff --git a/src/common/appInsightsClientFactory.ts b/src/common/appInsightsClientFactory.ts index d5cc759..8b7f5e8 100644 --- a/src/common/appInsightsClientFactory.ts +++ b/src/common/appInsightsClientFactory.ts @@ -11,7 +11,7 @@ import { ReplacementOption, SenderData } from "./baseTelemetryReporter"; import { BaseTelemetryClient } from "./baseTelemetrySender"; import { TelemetryUtil } from "./util"; -export const appInsightsClientFactory = async (connectionString: string, machineId: string, xhrOverride?: IXHROverride, replacementOptions?: ReplacementOption[]): Promise => { +export const appInsightsClientFactory = async (connectionString: string, machineId: string, sessionId: string, xhrOverride?: IXHROverride, replacementOptions?: ReplacementOption[]): Promise => { let appInsightsClient: ApplicationInsights | undefined; try { const basicAISDK = await import/* webpackMode: "eager" */("@microsoft/applicationinsights-web-basic"); @@ -52,7 +52,7 @@ export const appInsightsClientFactory = async (connectionString: string, machine name: eventName, data: properties, baseType: "EventData", - ext: { user: { id: machineId, authId: machineId } }, + ext: { user: { id: machineId, authId: machineId }, app: { sesId: sessionId } }, baseData: { name: eventName, properties: data?.properties, measurements: data?.measurements } }); }, diff --git a/src/node/telemetryReporter.ts b/src/node/telemetryReporter.ts index ae2bee0..0b92d9a 100644 --- a/src/node/telemetryReporter.ts +++ b/src/node/telemetryReporter.ts @@ -55,7 +55,7 @@ function getXHROverride() { export default class TelemetryReporter extends BaseTelemetryReporter { constructor(connectionString: string, replacementOptions?: ReplacementOption[]) { - let clientFactory = (connectionString: string) => appInsightsClientFactory(connectionString, vscode.env.machineId, getXHROverride(), replacementOptions); + let clientFactory = (connectionString: string) => appInsightsClientFactory(connectionString, vscode.env.machineId, vscode.env.sessionId, getXHROverride(), replacementOptions); // If connection string is usable by 1DS use the 1DS SDk if (TelemetryUtil.shouldUseOneDataSystemSDK(connectionString)) { clientFactory = (key: string) => oneDataSystemClientFactory(key, vscode, getXHROverride());