From 7c22e4203ed230550f3beba345972262632e4ab0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Dec 2024 17:05:31 +0000 Subject: [PATCH 1/3] Bump @vscode/extension-telemetry from 0.4.10 to 0.9.8 Bumps [@vscode/extension-telemetry](https://github.com/Microsoft/vscode-extension-telemetry) from 0.4.10 to 0.9.8. - [Release notes](https://github.com/Microsoft/vscode-extension-telemetry/releases) - [Commits](https://github.com/Microsoft/vscode-extension-telemetry/compare/v0.4.10...v0.9.8) --- updated-dependencies: - dependency-name: "@vscode/extension-telemetry" dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 132 +++++++++++++++++++++++++++++++++++++++++++--- package.json | 2 +- 2 files changed, 126 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index b39a7d6e2..4285cdaa7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "2.34.2024121211", "license": "MPL-2.0", "dependencies": { - "@vscode/extension-telemetry": "^0.4.9", + "@vscode/extension-telemetry": "^0.9.8", "@zodios/core": "^10.9.2", "@zodios/plugins": "^10.6.0", "axios": "^1.7.4", @@ -1114,6 +1114,107 @@ "node": ">= 18" } }, + "node_modules/@microsoft/1ds-core-js": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/@microsoft/1ds-core-js/-/1ds-core-js-4.3.4.tgz", + "integrity": "sha512-3gbDUQgAO8EoyQTNcAEkxpuPnioC0May13P1l1l0NKZ128L9Ts/sj8QsfwCRTjHz0HThlA+4FptcAJXNYUy3rg==", + "dependencies": { + "@microsoft/applicationinsights-core-js": "3.3.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.3", + "@nevware21/ts-async": ">= 0.5.2 < 2.x", + "@nevware21/ts-utils": ">= 0.11.3 < 2.x" + } + }, + "node_modules/@microsoft/1ds-post-js": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/@microsoft/1ds-post-js/-/1ds-post-js-4.3.4.tgz", + "integrity": "sha512-nlKjWricDj0Tn68Dt0P8lX9a+X7LYrqJ6/iSfQwMfDhRIGLqW+wxx8gxS+iGWC/oc8zMQAeiZaemUpCwQcwpRQ==", + "dependencies": { + "@microsoft/1ds-core-js": "4.3.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.3", + "@nevware21/ts-async": ">= 0.5.2 < 2.x", + "@nevware21/ts-utils": ">= 0.11.3 < 2.x" + } + }, + "node_modules/@microsoft/applicationinsights-channel-js": { + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-channel-js/-/applicationinsights-channel-js-3.3.4.tgz", + "integrity": "sha512-Z4nrxYwGKP9iyrYtm7iPQXVOFy4FsEsX0nDKkAi96Qpgw+vEh6NH4ORxMMuES0EollBQ3faJyvYCwckuCVIj0g==", + "dependencies": { + "@microsoft/applicationinsights-common": "3.3.4", + "@microsoft/applicationinsights-core-js": "3.3.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.3", + "@nevware21/ts-async": ">= 0.5.2 < 2.x", + "@nevware21/ts-utils": ">= 0.11.3 < 2.x" + }, + "peerDependencies": { + "tslib": ">= 1.0.0" + } + }, + "node_modules/@microsoft/applicationinsights-common": { + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-common/-/applicationinsights-common-3.3.4.tgz", + "integrity": "sha512-4ms16MlIvcP4WiUPqopifNxcWCcrXQJ2ADAK/75uok2mNQe6ZNRsqb/P+pvhUxc8A5HRlvoXPP1ptDSN5Girgw==", + "dependencies": { + "@microsoft/applicationinsights-core-js": "3.3.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.3", + "@nevware21/ts-utils": ">= 0.11.3 < 2.x" + }, + "peerDependencies": { + "tslib": ">= 1.0.0" + } + }, + "node_modules/@microsoft/applicationinsights-core-js": { + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-core-js/-/applicationinsights-core-js-3.3.4.tgz", + "integrity": "sha512-MummANF0mgKIkdvVvfmHQTBliK114IZLRhTL0X0Ep+zjDwWMHqYZgew0nlFKAl6ggu42abPZFK5afpE7qjtYJA==", + "dependencies": { + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.3", + "@nevware21/ts-async": ">= 0.5.2 < 2.x", + "@nevware21/ts-utils": ">= 0.11.3 < 2.x" + }, + "peerDependencies": { + "tslib": ">= 1.0.0" + } + }, + "node_modules/@microsoft/applicationinsights-shims": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-shims/-/applicationinsights-shims-3.0.1.tgz", + "integrity": "sha512-DKwboF47H1nb33rSUfjqI6ryX29v+2QWcTrRvcQDA32AZr5Ilkr7whOOSsD1aBzwqX0RJEIP1Z81jfE3NBm/Lg==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.9.4 < 2.x" + } + }, + "node_modules/@microsoft/applicationinsights-web-basic": { + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/@microsoft/applicationinsights-web-basic/-/applicationinsights-web-basic-3.3.4.tgz", + "integrity": "sha512-OpEPXr8vU/t/M8T9jvWJzJx/pCyygIiR1nGM/2PTde0wn7anl71Gxl5fWol7K/WwFEORNjkL3CEyWOyDc+28AA==", + "dependencies": { + "@microsoft/applicationinsights-channel-js": "3.3.4", + "@microsoft/applicationinsights-common": "3.3.4", + "@microsoft/applicationinsights-core-js": "3.3.4", + "@microsoft/applicationinsights-shims": "3.0.1", + "@microsoft/dynamicproto-js": "^2.0.3", + "@nevware21/ts-async": ">= 0.5.2 < 2.x", + "@nevware21/ts-utils": ">= 0.11.3 < 2.x" + }, + "peerDependencies": { + "tslib": ">= 1.0.0" + } + }, + "node_modules/@microsoft/dynamicproto-js": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@microsoft/dynamicproto-js/-/dynamicproto-js-2.0.3.tgz", + "integrity": "sha512-JTWTU80rMy3mdxOjjpaiDQsTLZ6YSGGqsjURsY6AUQtIj0udlF/jYmhdLZu8693ZIC0T1IwYnFa0+QeiMnziBA==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.10.4 < 2.x" + } + }, "node_modules/@mswjs/interceptors": { "version": "0.37.3", "resolved": "https://registry.npmjs.org/@mswjs/interceptors/-/interceptors-0.37.3.tgz", @@ -1131,6 +1232,19 @@ "node": ">=18" } }, + "node_modules/@nevware21/ts-async": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/@nevware21/ts-async/-/ts-async-0.5.3.tgz", + "integrity": "sha512-UsF7eerLsVfid7iV1oXF80qXBwHNBeqSqfh/nPZgirRU1MACmSsj83EZKS2ViFHVfSGG6WIuXMGBP6KciXfYhA==", + "dependencies": { + "@nevware21/ts-utils": ">= 0.11.5 < 2.x" + } + }, + "node_modules/@nevware21/ts-utils": { + "version": "0.11.5", + "resolved": "https://registry.npmjs.org/@nevware21/ts-utils/-/ts-utils-0.11.5.tgz", + "integrity": "sha512-7nIzWKR50mf3htOg53kwPLqD5iJaRfVyBvb1NJhlIncyP1WzK8vAQbU9rqIsRtv7td1CnqspdP6IWNEjOjaeug==" + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", @@ -1601,11 +1715,16 @@ } }, "node_modules/@vscode/extension-telemetry": { - "version": "0.4.10", - "resolved": "https://registry.npmjs.org/@vscode/extension-telemetry/-/extension-telemetry-0.4.10.tgz", - "integrity": "sha512-XgyUoWWRQExTmd9DynIIUQo1NPex/zIeetdUAXeBjVuW9ioojM1TcDaSqOa/5QLC7lx+oEXwSU1r0XSBgzyz6w==", + "version": "0.9.8", + "resolved": "https://registry.npmjs.org/@vscode/extension-telemetry/-/extension-telemetry-0.9.8.tgz", + "integrity": "sha512-7YcKoUvmHlIB8QYCE4FNzt3ErHi9gQPhdCM3ZWtpw1bxPT0I+lMdx52KHlzTNoJzQ2NvMX7HyzyDwBEiMgTrWQ==", + "dependencies": { + "@microsoft/1ds-core-js": "^4.3.4", + "@microsoft/1ds-post-js": "^4.3.4", + "@microsoft/applicationinsights-web-basic": "^3.3.4" + }, "engines": { - "vscode": "^1.60.0" + "vscode": "^1.75.0" } }, "node_modules/@vscode/test-cli": { @@ -9135,8 +9254,7 @@ "node_modules/tslib": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", - "dev": true + "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, "node_modules/tsscmp": { "version": "1.0.6", diff --git a/package.json b/package.json index de1345c97..1cadceaaa 100644 --- a/package.json +++ b/package.json @@ -955,7 +955,7 @@ "changelog:build": "changie batch auto && changie merge && npm i --package-lock-only" }, "dependencies": { - "@vscode/extension-telemetry": "^0.4.9", + "@vscode/extension-telemetry": "^0.9.8", "@zodios/core": "^10.9.2", "@zodios/plugins": "^10.6.0", "axios": "^1.7.4", From db2a82853424f858ed484dab725af7f5183b2648 Mon Sep 17 00:00:00 2001 From: James Pogran Date: Mon, 9 Dec 2024 16:32:32 -0500 Subject: [PATCH 2/3] Update telemetry API calls --- src/extension.ts | 17 +++++++++++++---- src/features/telemetry.ts | 6 +++++- src/providers/tfc/applyProvider.ts | 5 ++++- src/providers/tfc/authenticationProvider.ts | 19 +++++++++++++++---- src/providers/tfc/organizationPicker.ts | 10 ++++++++-- src/providers/tfc/planProvider.ts | 5 ++++- src/providers/tfc/runProvider.ts | 10 ++++++++-- src/providers/tfc/uiHelpers.ts | 5 ++++- src/providers/tfc/workspaceFilters.ts | 10 ++++++++-- src/providers/tfc/workspaceProvider.ts | 10 ++++++++-- src/utils/vscode.ts | 9 +++++++-- src/web/extension.ts | 2 +- 12 files changed, 85 insertions(+), 23 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index ee64e53c3..167e77e3f 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -61,7 +61,7 @@ export async function activate(context: vscode.ExtensionContext): Promise } const manifest = context.extension.packageJSON; - reporter = new TelemetryReporter(context.extension.id, manifest.version, manifest.appInsightsKey); + reporter = new TelemetryReporter(manifest.appInsightsKey); context.subscriptions.push(reporter); // always register commands needed to control terraform-ls @@ -102,7 +102,11 @@ export async function activate(context: vscode.ExtensionContext): Promise initializationFailedHandler: (error: ResponseError | Error) => { initializationError = error; - reporter.sendTelemetryException(error); + reporter.sendTelemetryErrorEvent('initializationError', { + message: error.message, + stack: error.stack, + code: error instanceof ResponseError ? error.code.toString() : undefined, + }); let msg = 'Failure to start terraform-ls. Please check your configuration settings and reload this window'; @@ -235,12 +239,17 @@ export async function deactivate(): Promise { } catch (error) { if (error instanceof Error) { outputChannel.appendLine(error.message); - reporter.sendTelemetryException(error); + reporter.sendTelemetryErrorEvent('deactivate', { + message: error.message, + stack: error.stack, + }); vscode.window.showErrorMessage(error.message); lsStatus.setLanguageServerState(error.message, false, vscode.LanguageStatusSeverity.Error); } else if (typeof error === 'string') { outputChannel.appendLine(error); - reporter.sendTelemetryException(new Error(error)); + reporter.sendTelemetryErrorEvent('deactivate', { + message: error, + }); vscode.window.showErrorMessage(error); lsStatus.setLanguageServerState(error, false, vscode.LanguageStatusSeverity.Error); } diff --git a/src/features/telemetry.ts b/src/features/telemetry.ts index 02197a42c..57f44892e 100644 --- a/src/features/telemetry.ts +++ b/src/features/telemetry.ts @@ -52,7 +52,11 @@ export class TelemetryFeature implements StaticFeature { return; } - this.reporter.sendRawTelemetryEvent(event.name, event.properties); + const thing: Record = {}; + for (const [key, value] of Object.entries(event.properties)) { + thing[key] = String(value); + } + this.reporter.sendRawTelemetryEvent(event.name, thing); }), ); } diff --git a/src/providers/tfc/applyProvider.ts b/src/providers/tfc/applyProvider.ts index 8d5a7019d..8d54729d1 100644 --- a/src/providers/tfc/applyProvider.ts +++ b/src/providers/tfc/applyProvider.ts @@ -164,7 +164,10 @@ export class ApplyTreeDataProvider implements vscode.TreeDataProvider Date: Mon, 9 Dec 2024 16:46:14 -0500 Subject: [PATCH 3/3] Connection string --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1cadceaaa..aae63e0ad 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "description": "Syntax highlighting and autocompletion for Terraform", "version": "2.34.2024121211", "publisher": "hashicorp", - "appInsightsKey": "885372d2-6f3c-499f-9d25-b8b219983a52", + "appInsightsKey": "InstrumentationKey=885372d2-6f3c-499f-9d25-b8b219983a52;IngestionEndpoint=https://westus2-1.in.applicationinsights.azure.com/;LiveEndpoint=https://westus2.livediagnostics.monitor.azure.com/;ApplicationId=6734158a-8ab9-4aec-9b5a-af151d14a754", "license": "MPL-2.0", "preview": false, "private": true,