Skip to content

Commit 18bb45b

Browse files
authored
Use raw app insights keys for the telemetry reporter (#1116)
Our telemetry setup doesn't work with vscode-extension-telemetry 0.9.0+, after they updated their internal app insights reporter dependency. Debugging the issue showed that app insights reporter silently fails with 400 errors, saying that instrumentation key params are incorrect. The usage docs explicitly mention to use "Instrumentation Key" while creating the reporter instance, not the "Connection String" which we were using in our setup. After changing it to they keys I can confirm that the events finally come through (in staging azure "deco-vscode" app insights)q
1 parent 53debe9 commit 18bb45b

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

packages/databricks-vscode/src/telemetry/constants.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import {AuthType} from "@databricks/databricks-sdk";
2-
/** The production application insights configuration string for Databricks. */
3-
export const PROD_APP_INSIGHTS_CONFIGURATION_STRING =
4-
"InstrumentationKey=ebe191c5-f06b-4189-b68c-34fb5fbdb3f0;IngestionEndpoint=https://eastus2-3.in.applicationinsights.azure.com/;LiveEndpoint=https://eastus2.livediagnostics.monitor.azure.com/";
5-
/** The application insights configuration string used while developing on the VS Code extension */
6-
export const DEV_APP_INSIGHTS_CONFIGURATION_STRING =
7-
"InstrumentationKey=257d1561-5005-4a76-a3a8-7955df129e86;IngestionEndpoint=https://eastus2-3.in.applicationinsights.azure.com/;LiveEndpoint=https://eastus2.livediagnostics.monitor.azure.com/";
2+
/** The production application insights instrumentation key for Databricks. */
3+
export const PROD_APP_INSIGHTS_CONFIGURATION_KEY =
4+
"ebe191c5-f06b-4189-b68c-34fb5fbdb3f0";
5+
/** The application insights instrumentation key used while developing on the VS Code extension */
6+
export const DEV_APP_INSIGHTS_CONFIGURATION_KEY =
7+
"257d1561-5005-4a76-a3a8-7955df129e86";
88

99
/** The list of all events which can be monitored. */
1010
/* eslint-disable @typescript-eslint/naming-convention */

packages/databricks-vscode/src/telemetry/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import TelemetryReporter from "@vscode/extension-telemetry";
22
import {DatabricksWorkspace} from "../configuration/DatabricksWorkspace";
33
import {isDevExtension} from "../utils/developmentUtils";
44
import {
5-
DEV_APP_INSIGHTS_CONFIGURATION_STRING,
5+
DEV_APP_INSIGHTS_CONFIGURATION_KEY,
66
EventProperties,
77
EventTypes,
88
ExtraMetadata,
99
Metadata,
1010
MetadataTypes,
11-
PROD_APP_INSIGHTS_CONFIGURATION_STRING,
11+
PROD_APP_INSIGHTS_CONFIGURATION_KEY,
1212
} from "./constants";
1313
import crypto from "crypto";
1414
import bcrypt from "bcryptjs";
@@ -90,9 +90,9 @@ export function getContextMetadata(): ExtraMetadata[Metadata.CONTEXT] {
9090

9191
function getTelemetryKey(): string {
9292
if (isDevExtension()) {
93-
return DEV_APP_INSIGHTS_CONFIGURATION_STRING;
93+
return DEV_APP_INSIGHTS_CONFIGURATION_KEY;
9494
}
95-
return PROD_APP_INSIGHTS_CONFIGURATION_STRING;
95+
return PROD_APP_INSIGHTS_CONFIGURATION_KEY;
9696
}
9797

9898
function getTelemetryReporter(): TelemetryReporter | undefined {

0 commit comments

Comments
 (0)