diff --git a/src/commands/cloudShell.ts b/src/commands/cloudShell.ts index eb63e8ce..3e9b7010 100644 --- a/src/commands/cloudShell.ts +++ b/src/commands/cloudShell.ts @@ -135,7 +135,18 @@ async function cloudShellSize(consoleUri: string, terminalId: string): Promise { if (options.templateUrl) { - context.telemetry.properties.templateUrl = options.templateUrl; + const repository = extractRepoFromGitHubUrl(options.templateUrl); + context.telemetry.properties.repository = repository; } }); } + +function extractRepoFromGitHubUrl(url: string): string { + const regex = /https:\/\/github\.com\/([^\/]+\/[^\/]+)/; + const match = url.match(regex); + if (match) { + return match[1]; + } else { + return ''; + } +}