diff --git a/packages/core/src/shared/lsp/utils/setupStage.ts b/packages/core/src/shared/lsp/utils/setupStage.ts index cd9dcfa319a..8f43ba16f3f 100644 --- a/packages/core/src/shared/lsp/utils/setupStage.ts +++ b/packages/core/src/shared/lsp/utils/setupStage.ts @@ -5,6 +5,7 @@ import { LanguageServerSetup, LanguageServerSetupStage, telemetry } from '../../telemetry/telemetry' import { tryFunctions } from '../../utilities/tsUtils' +import { AuthUtil } from '../../../codewhisperer/util/authUtil' /** * Runs the designated stage within a telemetry span and optionally uses the getMetadata extractor to record metadata from the result of the stage. @@ -20,6 +21,7 @@ export async function lspSetupStage( ) { return await telemetry.languageServer_setup.run(async (span) => { span.record({ languageServerSetupStage: stageName }) + span.record({ credentialStartUrl: AuthUtil.instance.startUrl ?? 'Undefined' }) const result = await runStage() if (getMetadata) { span.record(getMetadata(result)) diff --git a/packages/core/src/shared/telemetry/service-2.json b/packages/core/src/shared/telemetry/service-2.json index 9711b3473cc..a0ca9f7b14e 100644 --- a/packages/core/src/shared/telemetry/service-2.json +++ b/packages/core/src/shared/telemetry/service-2.json @@ -205,7 +205,8 @@ "AWSProduct", "AWSProductVersion", "ClientID", - "MetricData" + "MetricData", + "CredentialStartUrl" ], "members":{ "AWSProduct":{"shape":"AWSProduct"}, @@ -217,7 +218,8 @@ "ComputeEnv": {"shape":"ComputeEnv"}, "ParentProduct":{"shape":"Value"}, "ParentProductVersion":{"shape":"Value"}, - "MetricData":{"shape":"MetricData"} + "MetricData":{"shape":"MetricData"}, + "CredentialStartUrl": {"shape":"Value"} } }, "Sentiment":{ diff --git a/packages/core/src/shared/telemetry/telemetryClient.ts b/packages/core/src/shared/telemetry/telemetryClient.ts index 139b4b48814..97ec2508cfc 100644 --- a/packages/core/src/shared/telemetry/telemetryClient.ts +++ b/packages/core/src/shared/telemetry/telemetryClient.ts @@ -17,6 +17,7 @@ import globals from '../extensionGlobals' import { DevSettings } from '../settings' import { ClassToInterfaceType } from '../utilities/tsUtils' import { getComputeEnvType, getSessionId } from './util' +import { AuthUtil } from '../../codewhisperer/util/authUtil' export const accountMetadataKey = 'awsAccount' export const regionKey = 'awsRegion' @@ -112,6 +113,7 @@ export class DefaultTelemetryClient implements TelemetryClient { ParentProduct: vscode.env.appName, ParentProductVersion: vscode.version, MetricData: batch, + CredentialStartUrl: AuthUtil.instance.startUrl ?? 'Undefined', }) .promise() this.logger.info(`telemetry: sent batch (size=${batch.length})`) diff --git a/packages/core/src/shared/telemetry/vscodeTelemetry.json b/packages/core/src/shared/telemetry/vscodeTelemetry.json index 3bc103d81e3..1128eef8ab6 100644 --- a/packages/core/src/shared/telemetry/vscodeTelemetry.json +++ b/packages/core/src/shared/telemetry/vscodeTelemetry.json @@ -1221,6 +1221,42 @@ "required": false } ] + }, + { + "name": "languageServer_setup", + "description": "Sets up a language server", + "unit": "Milliseconds", + "passive": true, + "metadata": [ + { + "type": "id", + "required": true + }, + { + "type": "languageServerSetupStage", + "required": true + }, + { + "type": "languageServerLocation", + "required": false + }, + { + "type": "languageServerVersion", + "required": false + }, + { + "type": "manifestLocation", + "required": false + }, + { + "type": "manifestSchemaVersion", + "required": false + }, + { + "type": "credentialStartUrl", + "required": false + } + ] } ] }