Skip to content

Commit 40ba183

Browse files
atennak1Akila Tennakoon
andauthored
telemetry(cloudformation): add audit logging to CloudFormation LSP installer (#8364)
Ensures we have visibility into LSP version selection/installation if/when customers report installation related issues. ``` 2025-11-24 17:58:10.530 [info] awsCfnLsp: Found CloudFormation LSP provider: RemoteLspServerProvider 2025-11-24 17:58:11.078 [info] awsCfnLsp: Candidate versions: 1.1.0[darwin-arm64,darwin-x64,linux-arm64,linux-x64,win32-arm64,win32-x64,windows-arm64,windows-x64], 1.0.0[darwin-arm64,darwin-x64,linux-arm64,linux-x64,win32-arm64,win32-x64,windows-arm64,windows-x64] 2025-11-24 17:58:11.078 [info] awsCfnLsp: Creating CloudFormation LSP manifest for prod 2025-11-24 17:58:12.270 [info] lsp: Finished preparing "cloudformation-languageserver" LSP server: '/Users/tennakoo/Library/Caches/aws/toolkits/language-servers/cloudformation-languageserver/1.1.0' 2025-11-24 17:58:12.312 [info] awsCfnLsp: Found CloudFormation LSP executable: /Users/tennakoo/Library/Caches/aws/toolkits/language-servers/cloudformation-languageserver/1.1.0/cloudformation-languageserver-1.1.0-darwin-arm64-node22/cfn-lsp-server-standalone.js ``` *No tests added since no business logic modified* --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license. --------- Co-authored-by: Akila Tennakoon <[email protected]>
1 parent c39a8f0 commit 40ba183

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

packages/core/src/awsService/cloudformation/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ async function startClient(context: ExtensionContext) {
105105
if (!(await fs.existsFile(serverFile))) {
106106
throw new Error(`CloudFormation LSP ${serverFile} not found`)
107107
}
108-
getLogger().info(`Found CloudFormation LSP executable: ${serverFile}`)
108+
getLogger('awsCfnLsp').info(`Found CloudFormation LSP executable: ${serverFile}`)
109109
const serverRootDir = await serverProvider.serverRootDir()
110110

111111
const envOptions = {

packages/core/src/awsService/cloudformation/lsp-server/githubManifestAdapter.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,19 @@ export class GitHubManifestAdapter {
2121
const sortedReleases = envReleases.sort((a, b) => {
2222
return b.tag_name.localeCompare(a.tag_name)
2323
})
24+
const versions = dedupeAndGetLatestVersions(sortedReleases.map((release) => this.convertRelease(release)))
25+
getLogger('awsCfnLsp').info(
26+
'Candidate versions: %s',
27+
versions
28+
.map((v) => `${v.serverVersion}[${v.targets.map((t) => `${t.platform}-${t.arch}`).join(',')}]`)
29+
.join(', ')
30+
)
2431
return {
2532
manifestSchemaVersion: '1.0',
2633
artifactId: CfnLspName,
2734
artifactDescription: 'GitHub CloudFormation Language Server',
2835
isManifestDeprecated: false,
29-
versions: dedupeAndGetLatestVersions(sortedReleases.map((release) => this.convertRelease(release))),
36+
versions: versions,
3037
}
3138
}
3239

packages/core/src/awsService/cloudformation/lsp-server/lspInstaller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export class CfnLspInstaller extends BaseLspInstaller {
4141
'awsCfnLsp',
4242
{
4343
resolve: async () => {
44-
const log = getLogger()
44+
const log = getLogger('awsCfnLsp')
4545
const cfnManifestStorageKey = 'aws.cloudformation.lsp.manifest'
4646

4747
try {

packages/core/src/awsService/cloudformation/lsp-server/lspServerProvider.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import { Disposable } from 'vscode'
77
import { getLogger } from '../../../shared/logger/logger'
8+
import { ToolkitError } from '../../../shared/errors'
89

910
export interface LspServerResolverI {
1011
serverExecutable(): Promise<string>
@@ -29,7 +30,7 @@ export class LspServerProvider implements LspServerResolverI, Disposable {
2930
}
3031

3132
this.matchedProviders = matches
32-
getLogger().info(
33+
getLogger('awsCfnLsp').info(
3334
`Found CloudFormation LSP provider: ${this.matchedProviders.map((provider) => provider.name())}`
3435
)
3536
}
@@ -58,7 +59,9 @@ export class LspServerProvider implements LspServerResolverI, Disposable {
5859
this._serverRootDir = dir
5960
return
6061
} catch (err) {
61-
getLogger().error(`Failed to resolve CloudFormation LSP provider ${provider.name()}`, err)
62+
getLogger().error(
63+
ToolkitError.chain(err, `Failed to resolve CloudFormation LSP provider ${provider.name()}`)
64+
)
6265
}
6366
}
6467
}

0 commit comments

Comments
 (0)