diff --git a/src/common/copilot/PowerPagesCopilot.ts b/src/common/copilot/PowerPagesCopilot.ts index aac3fa79..4adfdeb3 100644 --- a/src/common/copilot/PowerPagesCopilot.ts +++ b/src/common/copilot/PowerPagesCopilot.ts @@ -15,7 +15,7 @@ import { IOrgInfo } from './model'; import { checkCopilotAvailability, escapeDollarSign, getActiveEditorContent, getNonce, getSelectedCode, getSelectedCodeLineRange, getUserName, openWalkthrough, showConnectedOrgMessage, showInputBoxAndGetOrgUrl, showProgressWithNotification } from "../utilities/Utils"; import { CESUserFeedback } from "./user-feedback/CESSurvey"; import { ActiveOrgOutput } from "../../client/pac/PacTypes"; -import { CopilotWalkthroughEvent, CopilotCopyCodeToClipboardEvent, CopilotInsertCodeToEditorEvent, CopilotLoadedEvent, CopilotOrgChangedEvent, CopilotUserFeedbackThumbsDownEvent, CopilotUserFeedbackThumbsUpEvent, CopilotUserPromptedEvent, CopilotCodeLineCountEvent, CopilotClearChatEvent, CopilotExplainCode, CopilotExplainCodeSize, CopilotNotAvailableECSConfig, CopilotPanelTryGitHubCopilotClicked } from "./telemetry/telemetryConstants"; +import { CopilotWalkthroughEvent, CopilotCopyCodeToClipboardEvent, CopilotInsertCodeToEditorEvent, CopilotLoadedEvent, CopilotOrgChangedEvent, CopilotUserFeedbackThumbsDownEvent, CopilotUserFeedbackThumbsUpEvent, CopilotUserPromptedEvent, CopilotCodeLineCountEvent, CopilotClearChatEvent, CopilotExplainCode, CopilotExplainCodeSize, CopilotNotAvailableECSConfig, CopilotPanelTryGitHubCopilotClicked, VSCodeExtensionGitHubChatPanelOpened, VSCodeExtensionGitHubChatNotFound } from "./telemetry/telemetryConstants"; import { sendTelemetryEvent } from "./telemetry/copilotTelemetry"; import TelemetryReporter from "@vscode/extension-telemetry"; import { getEntityColumns, getEntityName, getFormXml } from "./dataverseMetadata"; @@ -297,8 +297,10 @@ export class PowerPagesCopilot implements vscode.WebviewViewProvider { //Open the GitHub Copilot Chat with @powerpages if GitHub Copilot Chat is installed sendTelemetryEvent(this.telemetry, { eventName: CopilotPanelTryGitHubCopilotClicked, copilotSessionId: sessionID, orgId: orgID, userId: userID }); if (vscode.extensions.getExtension(GITHUB_COPILOT_CHAT_EXT)) { + sendTelemetryEvent(this.telemetry, { eventName: VSCodeExtensionGitHubChatPanelOpened, copilotSessionId: sessionID, orgId: orgID, userId: userID }); vscode.commands.executeCommand('workbench.action.chat.open', PowerPagesParticipantPrompt); } else { + sendTelemetryEvent(this.telemetry, { eventName: VSCodeExtensionGitHubChatNotFound, copilotSessionId: sessionID, orgId: orgID, userId: userID }); vscode.env.openExternal(vscode.Uri.parse(PowerPagesParticipantDocLink)); } } diff --git a/src/common/copilot/telemetry/telemetryConstants.ts b/src/common/copilot/telemetry/telemetryConstants.ts index 8567778d..08bee160 100644 --- a/src/common/copilot/telemetry/telemetryConstants.ts +++ b/src/common/copilot/telemetry/telemetryConstants.ts @@ -39,4 +39,6 @@ export const CopilotExplainCodeSize = 'CopilotExplainCodeSize'; export const CopilotNpsAuthenticationCompleted = "CopilotNpsAuthenticationCompleted"; export const CopilotNotificationTryGitHubCopilotClicked = 'CopilotNotificationTryGitHubCopilotClicked'; export const CopilotPanelTryGitHubCopilotClicked = 'CopilotPanelTryGitHubCopilotClicked '; +export const VSCodeExtensionGitHubChatPanelOpened = 'VSCodeExtensionGitHubChatPanelOpened'; +export const VSCodeExtensionGitHubChatNotFound = 'VSCodeExtensionGitHubChatNotFound'; diff --git a/src/common/copilot/welcome-notification/CopilotNotificationPanel.ts b/src/common/copilot/welcome-notification/CopilotNotificationPanel.ts index 50dedceb..4a3cee73 100644 --- a/src/common/copilot/welcome-notification/CopilotNotificationPanel.ts +++ b/src/common/copilot/welcome-notification/CopilotNotificationPanel.ts @@ -6,7 +6,7 @@ import * as vscode from "vscode"; import { getNonce } from "../../utilities/Utils"; import TelemetryReporter from "@vscode/extension-telemetry"; -import { CopilotNotificationDoNotShowChecked, CopilotTryNotificationClickedEvent, CopilotNotificationDoNotShowUnchecked, CopilotNotificationTryGitHubCopilotClicked } from "../telemetry/telemetryConstants"; +import { CopilotNotificationDoNotShowChecked, CopilotTryNotificationClickedEvent, CopilotNotificationDoNotShowUnchecked, CopilotNotificationTryGitHubCopilotClicked, VSCodeExtensionGitHubChatPanelOpened, VSCodeExtensionGitHubChatNotFound } from "../telemetry/telemetryConstants"; import { COPILOT_IN_POWERPAGES, COPILOT_NOTIFICATION_DISABLED, PowerPagesParticipantDocLink, PowerPagesParticipantPrompt } from "../constants"; import { oneDSLoggerWrapper } from "../../OneDSLoggerTelemetry/oneDSLoggerWrapper"; @@ -59,8 +59,12 @@ export async function copilotNotificationPanel(context: vscode.ExtensionContext, telemetry.sendTelemetryEvent(CopilotNotificationTryGitHubCopilotClicked, { listOfOrgs: telemetryData, countOfActivePortals: countOfActivePortals as string }); oneDSLoggerWrapper.getLogger().traceInfo(CopilotNotificationTryGitHubCopilotClicked, { listOfOrgs: telemetryData, countOfActivePortals: countOfActivePortals as string }); if (isGitHubCopilotPresent) { + telemetry.sendTelemetryEvent(VSCodeExtensionGitHubChatPanelOpened, { listOfOrgs: telemetryData, countOfActivePortals: countOfActivePortals as string }); + oneDSLoggerWrapper.getLogger().traceInfo(VSCodeExtensionGitHubChatPanelOpened, { listOfOrgs: telemetryData, countOfActivePortals: countOfActivePortals as string }); vscode.commands.executeCommand('workbench.action.chat.open', PowerPagesParticipantPrompt); } else { + telemetry.sendTelemetryEvent(VSCodeExtensionGitHubChatNotFound, { listOfOrgs: telemetryData, countOfActivePortals: countOfActivePortals as string }); + oneDSLoggerWrapper.getLogger().traceInfo(VSCodeExtensionGitHubChatNotFound, { listOfOrgs: telemetryData, countOfActivePortals: countOfActivePortals as string }); vscode.env.openExternal(vscode.Uri.parse(PowerPagesParticipantDocLink)); } }