Skip to content

Commit a6e0b6e

Browse files
Merge master into feature/logs
2 parents 80b150f + 1085a8d commit a6e0b6e

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

packages/amazonq/src/lsp/client.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import { processUtils } from 'aws-core-vscode/shared'
3939
import { activate } from './chat/activation'
4040
import { AmazonQResourcePaths } from './lspInstaller'
4141
import { ConfigSection, isValidConfigSection, toAmazonQLSPLogLevel } from './config'
42+
import { telemetry } from 'aws-core-vscode/telemetry'
4243

4344
const localize = nls.loadMessageBundle()
4445
const logger = getLogger('amazonqLsp.lspClient')
@@ -293,6 +294,12 @@ function onServerRestartHandler(client: LanguageClient, auth: AmazonQLspAuth) {
293294
return
294295
}
295296

297+
// Emit telemetry that a crash was detected.
298+
// It is not guaranteed to 100% be a crash since somehow the server may have been intentionally restarted,
299+
// but most of the time it probably will have been due to a crash.
300+
// TODO: Port this metric override to common definitions
301+
telemetry.languageServer_crash.emit({ id: 'AmazonQ' })
302+
296303
// Need to set the auth token in the again
297304
await auth.refreshConnection(true)
298305
})

packages/core/src/shared/telemetry/vscodeTelemetry.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,6 +1019,15 @@
10191019
}
10201020
]
10211021
},
1022+
{
1023+
"name": "languageServer_crash",
1024+
"description": "Called when a language server crash is detected. TODO: Port this to common",
1025+
"metadata": [
1026+
{
1027+
"type": "id"
1028+
}
1029+
]
1030+
},
10221031
{
10231032
"name": "ide_heartbeat",
10241033
"description": "A heartbeat sent by the extension",

0 commit comments

Comments
 (0)