@vscode/extension-telemetry
Advanced tools
Comparing version 0.9.7 to 0.9.8
@@ -23,3 +23,3 @@ /*--------------------------------------------------------- | ||
constructor(connectionString, replacementOptions) { | ||
let clientFactory = (connectionString) => appInsightsClientFactory(connectionString, vscode.env.machineId, undefined, replacementOptions); | ||
let clientFactory = (connectionString) => appInsightsClientFactory(connectionString, vscode.env.machineId, vscode.env.sessionId, undefined, replacementOptions); | ||
// If key is usable by 1DS use the 1DS SDk | ||
@@ -26,0 +26,0 @@ if (TelemetryUtil.shouldUseOneDataSystemSDK(connectionString)) { |
@@ -7,3 +7,3 @@ /*--------------------------------------------------------------------------------------------- | ||
import { TelemetryUtil } from "./util"; | ||
export const appInsightsClientFactory = async (connectionString, machineId, xhrOverride, replacementOptions) => { | ||
export const appInsightsClientFactory = async (connectionString, machineId, sessionId, xhrOverride, replacementOptions) => { | ||
let appInsightsClient; | ||
@@ -21,4 +21,9 @@ try { | ||
} | ||
let instrumentationKey; | ||
if (!connectionString.startsWith("InstrumentationKey=")) { | ||
instrumentationKey = connectionString; | ||
} | ||
const authConfig = instrumentationKey ? { instrumentationKey } : { connectionString }; | ||
appInsightsClient = new basicAISDK.ApplicationInsights({ | ||
connectionString: connectionString, | ||
...authConfig, | ||
disableAjaxTracking: true, | ||
@@ -49,3 +54,3 @@ disableExceptionTracking: true, | ||
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 } | ||
@@ -52,0 +57,0 @@ }); |
@@ -53,3 +53,3 @@ /*--------------------------------------------------------- | ||
// Do not change this string as it gets found and replaced upon packaging | ||
"common.telemetryclientversion": "0.9.7" | ||
"common.telemetryclientversion": "0.9.8" | ||
}; | ||
@@ -56,0 +56,0 @@ } |
@@ -33,3 +33,3 @@ "use strict"; | ||
const util_1 = require("./util"); | ||
const appInsightsClientFactory = async (connectionString, machineId, xhrOverride, replacementOptions) => { | ||
const appInsightsClientFactory = async (connectionString, machineId, sessionId, xhrOverride, replacementOptions) => { | ||
let appInsightsClient; | ||
@@ -47,4 +47,9 @@ try { | ||
} | ||
let instrumentationKey; | ||
if (!connectionString.startsWith("InstrumentationKey=")) { | ||
instrumentationKey = connectionString; | ||
} | ||
const authConfig = instrumentationKey ? { instrumentationKey } : { connectionString }; | ||
appInsightsClient = new basicAISDK.ApplicationInsights({ | ||
connectionString: connectionString, | ||
...authConfig, | ||
disableAjaxTracking: true, | ||
@@ -75,3 +80,3 @@ disableExceptionTracking: true, | ||
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 } | ||
@@ -78,0 +83,0 @@ }); |
@@ -56,3 +56,3 @@ "use strict"; | ||
// Do not change this string as it gets found and replaced upon packaging | ||
"common.telemetryclientversion": "0.9.7" | ||
"common.telemetryclientversion": "0.9.8" | ||
}; | ||
@@ -59,0 +59,0 @@ } |
@@ -80,3 +80,3 @@ "use strict"; | ||
constructor(connectionString, replacementOptions) { | ||
let clientFactory = (connectionString) => (0, appInsightsClientFactory_1.appInsightsClientFactory)(connectionString, vscode.env.machineId, getXHROverride(), replacementOptions); | ||
let clientFactory = (connectionString) => (0, appInsightsClientFactory_1.appInsightsClientFactory)(connectionString, vscode.env.machineId, vscode.env.sessionId, getXHROverride(), replacementOptions); | ||
// If connection string is usable by 1DS use the 1DS SDk | ||
@@ -83,0 +83,0 @@ if (util_1.TelemetryUtil.shouldUseOneDataSystemSDK(connectionString)) { |
{ | ||
"name": "@vscode/extension-telemetry", | ||
"description": "A module for Visual Studio Code extensions to report consistent telemetry.", | ||
"version": "0.9.7", | ||
"version": "0.9.8", | ||
"author": { | ||
@@ -23,5 +23,5 @@ "name": "Microsoft Corporation" | ||
"dependencies": { | ||
"@microsoft/1ds-core-js": "^4.3.0", | ||
"@microsoft/1ds-post-js": "^4.3.0", | ||
"@microsoft/applicationinsights-web-basic": "^3.3.0" | ||
"@microsoft/1ds-core-js": "^4.3.4", | ||
"@microsoft/1ds-post-js": "^4.3.4", | ||
"@microsoft/applicationinsights-web-basic": "^3.3.4" | ||
}, | ||
@@ -28,0 +28,0 @@ "devDependencies": { |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
69755
1270
2