src/vs/platform/telemetry/common/telemetry.ts

119 LOC · 115 covered · 4 uncovered · 3 ranges · 8711 concepts · 1 introducers · 4470 tests

File neighbourhood

The centred file is linked to every concept that introduces one of its ranges, every test that runs code from the file, and the gray connector concepts standing between those tests and the file's own introducer concepts. Undirected links join concepts to every file where they introduce source and concepts to the tests they introduce; arrows show specialization between the displayed concepts and bridge only concepts omitted from this view. Concept colors match the source ranges below; connector concepts have no source color and are shown in gray.

Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the file

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the related-file, concept, and source links on this page.

Focused file, its introducer and connector concepts, their introduced files, and tests that run code from the fileextensionPromptFileService.ts ×3 · 11 introduced LOCextensionPromptFileServi…promptsServiceImpl.ts ×6 · 16 introduced LOCpromptsServiceImpl.ts ×6promptsService.test|title=PromptsService findAgentSkills should return empty array when no skills found|occurrence=1 · 0 introduced LOCpromptsService.test|titl…chatService.test|title=ChatService troubleshoot skill via attachedContext proceeds when fileLogging.enabled is on|occurrence=1 · 0 introduced LOCchatService.test|title=C…chatServiceImpl.ts ×3 · 41 introduced LOCchatServiceImpl.ts ×3chatServiceImpl.ts ×1 · 19 introduced LOCchatServiceImpl.ts ×1textModel.ts ×6 · 31 introduced LOCtextModel.ts ×6agentService.ts ×2 · 4 introduced LOCagentService.ts ×2agentService.ts ×3 · 7 introduced LOCagentService.ts ×3agentService.ts ×6 · 12 introduced LOCagentService.ts ×6copilotAgent.test|title=CopilotAgent client tool completion unblocks a pending permission request|occurrence=1 · 0 introduced LOCcopilotAgent.test|title=…copilotAgent.test|title=CopilotAgent auto-approves one duplicate write permission request after approval|occurrence=1 · 0 introduced LOCcopilotAgent.test|title=…copilotAgent.test|title=CopilotAgent requires confirmation when a second write permission request differs|occurrence=1 · 0 introduced LOCcopilotAgent.test|title=…copilotAgentSession.ts ×4 · 16 introduced LOCcopilotAgentSession.ts ×…agentService.ts ×2 · 4 introduced LOCagentService.ts ×2textModel.ts ×1 · 6 introduced LOCtextModel.ts ×1model.test|title=Editor Model - Words issue #61296: VS code freezes when editing CSS file with emoji|occurrence=1 · 0 introduced LOCmodel.test|title=Editor …copilotAgent.ts ×1 · 3 introduced LOCcopilotAgent.ts ×1chatSessionStore.test|title=ChatSessionStore workspace migration migration is triggered when onDidEnterWorkspace fires|occurrence=1 · 0 introduced LOCchatSessionStore.test|ti…chatSessionStore.ts ×2 · 10 introduced LOCchatSessionStore.ts ×2modelLineProjectionData.ts ×2 · 13 introduced LOCmodelLineProjectionData.…pieceTreeTextBuffer.ts ×1 · 3 introduced LOCpieceTreeTextBuffer.ts ×…pieceTreeTextBuffer.ts ×4 · 31 introduced LOCpieceTreeTextBuffer.ts ×…textModel.ts ×3 · 10 introduced LOCtextModel.ts ×3textModel.ts ×190 · 2948 introduced LOCtextModel.ts ×190chatImageExtraction.ts ×2 · 9 introduced LOCchatImageExtraction.ts ×…mcpServerRequestHandler.ts ×1 · 2 introduced LOCmcpServerRequestHandler.…mcpServerRequestHandler.ts ×1 · 4 introduced LOCmcpServerRequestHandler.…mcpServerRequestHandler.ts ×2 · 9 introduced LOCmcpServerRequestHandler.…promptFilesLocator.test|title=PromptFilesLocator empty workspace empty filesystem object config value|occurrence=1 · 0 introduced LOCpromptFilesLocator.test|…workbenchTestServices.ts ×1 · 2 introduced LOCworkbenchTestServices.ts…mockFilesystem.ts ×2 · 6 introduced LOCmockFilesystem.ts ×2mapSessionEvents.ts ×2 · 10 introduced LOCmapSessionEvents.ts ×2extensionsProfileScannerService.test|title=ExtensionsProfileScannerService write extensions located in different extensions folder does not has relative location|occurrence=1 · 0 introduced LOCextensionsProfileScanner…extensionsProfileScannerService.test|title=ExtensionsProfileScannerService write extensions located in the same extensions folder has relative location|occurrence=1 · 0 introduced LOCextensionsProfileScanner…extensionsProfileScannerService.ts ×2 · 6 introduced LOCextensionsProfileScanner…extensionsProfileScannerService.test|title=ExtensionsProfileScannerService read extension when uuid is different in identifier and manifest|occurrence=1 · 0 introduced LOCextensionsProfileScanner…extensionsProfileScannerService.test|title=ExtensionsProfileScannerService read extension when manifest is empty|occurrence=1, extensionsProfileScannerService.test|title=ExtensionsProfileScannerService read extension when manifest has empty lines and spaces|occurrence=1 · 0 introduced LOCextensionsProfileScanner…fileService.ts ×2 · 12 introduced LOCfileService.ts ×2chatEntitlementService.ts ×2 · 5 introduced LOCchatEntitlementService.t…chatEntitlementService.ts ×52 · 1538 introduced LOCchatEntitlementService.t…mime.ts ×1 · 4 introduced LOCmime.ts ×1log.ts ×5 · 36 introduced LOClog.ts ×5agentHostStateManager.test|title=AgentHostStateManager default chat inherits the session working directory resolved at materialization|occurrence=1 · 0 introduced LOCagentHostStateManager.te…virtualWorkspace.ts ×5 · 18 introduced LOCvirtualWorkspace.ts ×5instantiationServiceMock.ts ×1 · 2 introduced LOCinstantiationServiceMock…lifecycle.ts ×1 · 2 introduced LOClifecycle.ts ×1sessionState.ts ×1 · 2 introduced LOCsessionState.ts ×1agentHostTelemetryReporter.test|title=AgentHostTelemetryReporter toolCallDetails emits toolCallDetailsExternal + toolCallDetailsInternal aggregate whenever tools were available, and no-ops when none were|occurrence=1 · 0 introduced LOCagentHostTelemetryReport…sessionState.ts ×2 · 4 introduced LOCsessionState.ts ×2telemetryUtils.ts ×15 · 213 introduced LOCtelemetryUtils.ts ×15agentHostSchema.ts ×3 · 9 introduced LOCagentHostSchema.ts ×3agentHostSchema.ts ×21 · 546 introduced LOCagentHostSchema.ts ×21telemetry.ts ×3 · 115 introduced LOCtelemetry.ts ×3linesTextBuffer.test|title=PieceTreeTextBuffer._getInverseEdits multiline delete|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/model/linesTextBuffer/linesTextBuffer.test|title=PieceTreeTextBuffer._getInverseEdits multiline delete|occurrence=1linesTextBuffer.test|tit…linesTextBuffer.test|title=PieceTreeTextBuffer._getInverseEdits single delete|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/model/linesTextBuffer/linesTextBuffer.test|title=PieceTreeTextBuffer._getInverseEdits single delete|occurrence=1linesTextBuffer.test|tit…model.test|title=Editor Model - Words issue #61296: VS code freezes when editing CSS file with emoji|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/model/model.test|title=Editor Model - Words issue #61296: VS code freezes when editing CSS file with emoji|occurrence=1model.test|title=Editor …modelInjectedText.test|title=Editor Model - Injected Text Events Basic|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/model/modelInjectedText.test|title=Editor Model - Injected Text Events Basic|occurrence=1modelInjectedText.test|t…textModelWithTokens.test|title=TextModelWithTokens regression tests issue #63822: Wrong embedded language detected for empty lines|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/model/textModelWithTokens.test|title=TextModelWithTokens regression tests issue #63822: Wrong embedded language detected for empty lines|occurrence=1textModelWithTokens.test…lineBreakData.test|title=Editor ViewModel - LineBreakData Basic|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/viewModel/lineBreakData.test|title=Editor ViewModel - LineBreakData Basic|occurrence=1lineBreakData.test|title…agentHostSchema.test|title=agentHostSchema normalizeAgentHostTerminalAutoApproveRulesConfig keeps null entries and object rules|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/common/agentHostSchema.test|title=agentHostSchema normalizeAgentHostTerminalAutoApproveRulesConfig keeps null entries and object rules|occurrence=1agentHostSchema.test|tit…agentHostStateManager.test|title=AgentHostStateManager default chat inherits the session working directory resolved at materialization|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostStateManager.test|title=AgentHostStateManager default chat inherits the session working directory resolved at materialization|occurrence=1agentHostStateManager.te…agentHostTelemetryReporter.test|title=AgentHostTelemetryReporter toolCallDetails emits toolCallDetailsExternal + toolCallDetailsInternal aggregate whenever tools were available, and no-ops when none were|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentHostTelemetryReporter.test|title=AgentHostTelemetryReporter toolCallDetails emits toolCallDetailsExternal + toolCallDetailsInternal aggregate whenever tools were available, and no-ops when none were|occurrence=1agentHostTelemetryReport…agentService.test|title=AgentService (node dispatcher) peer chat catalog persistence onDidChangeChatData re-persists the updated providerData blob|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentService.test|title=AgentService (node dispatcher) peer chat catalog persistence onDidChangeChatData re-persists the updated providerData blob|occurrence=1agentService.test|title=…agentService.test|title=AgentService (node dispatcher) user-message attachment rewriting preserves the original attachment when the source cannot be read|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentService.test|title=AgentService (node dispatcher) user-message attachment rewriting preserves the original attachment when the source cannot be read|occurrence=1agentService.test|title=…agentService.test|title=AgentService (node dispatcher) user-message attachment rewriting snapshots Resource attachments by reading the original file and rewriting to a local snapshot|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/agentService.test|title=AgentService (node dispatcher) user-message attachment rewriting snapshots Resource attachments by reading the original file and rewriting to a local snapshot|occurrence=1agentService.test|title=…copilotAgent.test|title=CopilotAgent auto-approves one duplicate write permission request after approval|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/copilotAgent.test|title=CopilotAgent auto-approves one duplicate write permission request after approval|occurrence=1copilotAgent.test|title=…copilotAgent.test|title=CopilotAgent client tool completion unblocks a pending permission request|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/copilotAgent.test|title=CopilotAgent client tool completion unblocks a pending permission request|occurrence=1copilotAgent.test|title=…copilotAgent.test|title=CopilotAgent provisional sessions disposeSession on provisional session does not call client.deleteSession|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/copilotAgent.test|title=CopilotAgent provisional sessions disposeSession on provisional session does not call client.deleteSession|occurrence=1copilotAgent.test|title=…copilotAgent.test|title=CopilotAgent provisional sessions disposeSession on provisional session does not touch SDK or worktree|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/copilotAgent.test|title=CopilotAgent provisional sessions disposeSession on provisional session does not touch SDK or worktree|occurrence=1copilotAgent.test|title=…copilotAgent.test|title=CopilotAgent requires confirmation when a second write permission request differs|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/copilotAgent.test|title=CopilotAgent requires confirmation when a second write permission request differs|occurrence=1copilotAgent.test|title=…mapSessionEvents.test|title=mapSessionEvents — history replay restores best-effort model, fallback agent, and attachments onto user messages|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/agentHost/test/node/mapSessionEvents.test|title=mapSessionEvents — history replay restores best-effort model, fallback agent, and attachments onto user messages|occurrence=1mapSessionEvents.test|ti…extensionsProfileScannerService.test|title=ExtensionsProfileScannerService extension in old format is read and migrated|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/extensionManagement/test/common/extensionsProfileScannerService.test|title=ExtensionsProfileScannerService extension in old format is read and migrated|occurrence=1extensionsProfileScanner…extensionsProfileScannerService.test|title=ExtensionsProfileScannerService read extension when manifest has empty lines and spaces|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/extensionManagement/test/common/extensionsProfileScannerService.test|title=ExtensionsProfileScannerService read extension when manifest has empty lines and spaces|occurrence=1extensionsProfileScanner…extensionsProfileScannerService.test|title=ExtensionsProfileScannerService read extension when manifest is empty|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/extensionManagement/test/common/extensionsProfileScannerService.test|title=ExtensionsProfileScannerService read extension when manifest is empty|occurrence=1extensionsProfileScanner…extensionsProfileScannerService.test|title=ExtensionsProfileScannerService read extension when the relative location is empty|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/extensionManagement/test/common/extensionsProfileScannerService.test|title=ExtensionsProfileScannerService read extension when the relative location is empty|occurrence=1extensionsProfileScanner…extensionsProfileScannerService.test|title=ExtensionsProfileScannerService read extension when uuid is different in identifier and manifest|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/extensionManagement/test/common/extensionsProfileScannerService.test|title=ExtensionsProfileScannerService read extension when uuid is different in identifier and manifest|occurrence=1extensionsProfileScanner…extensionsProfileScannerService.test|title=ExtensionsProfileScannerService write extensions located in different extensions folder does not has relative location|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/extensionManagement/test/common/extensionsProfileScannerService.test|title=ExtensionsProfileScannerService write extensions located in different extensions folder does not has relative location|occurrence=1extensionsProfileScanner…extensionsProfileScannerService.test|title=ExtensionsProfileScannerService write extensions located in the same extensions folder has relative location|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/extensionManagement/test/common/extensionsProfileScannerService.test|title=ExtensionsProfileScannerService write extensions located in the same extensions folder has relative location|occurrence=1extensionsProfileScanner…chatImageExtraction.test|title=extractImagesFromToolInvocationMessages skips non-image URIs|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/chat/test/common/chatImageExtraction.test|title=extractImagesFromToolInvocationMessages skips non-image URIs|occurrence=1chatImageExtraction.test…chatService.test|title=ChatService onWillSaveState persists session index synchronously so it survives reload|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/chat/test/common/chatService/chatService.test|title=ChatService onWillSaveState persists session index synchronously so it survives reload|occurrence=1chatService.test|title=C…chatService.test|title=ChatService troubleshoot skill via attachedContext is blocked when fileLogging.enabled is off|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/chat/test/common/chatService/chatService.test|title=ChatService troubleshoot skill via attachedContext is blocked when fileLogging.enabled is off|occurrence=1chatService.test|title=C…chatService.test|title=ChatService troubleshoot skill via attachedContext proceeds when fileLogging.enabled is on|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/chat/test/common/chatService/chatService.test|title=ChatService troubleshoot skill via attachedContext proceeds when fileLogging.enabled is on|occurrence=1chatService.test|title=C…chatSessionStore.test|title=ChatSessionStore transferred sessions storeTransferSession deletes preexisting transferred session file|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/chat/test/common/model/chatSessionStore.test|title=ChatSessionStore transferred sessions storeTransferSession deletes preexisting transferred session file|occurrence=1chatSessionStore.test|ti…chatSessionStore.test|title=ChatSessionStore workspace migration migration is triggered when onDidEnterWorkspace fires|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/chat/test/common/model/chatSessionStore.test|title=ChatSessionStore workspace migration migration is triggered when onDidEnterWorkspace fires|occurrence=1chatSessionStore.test|ti…promptsService.test|title=PromptsService findAgentSkills should return empty array when no skills found|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/chat/test/common/promptSyntax/service/promptsService.test|title=PromptsService findAgentSkills should return empty array when no skills found|occurrence=1promptsService.test|titl…promptsService.test|title=PromptsService listPromptFiles - extensions Contributed file with when clause is filtered inside PromptsService|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/chat/test/common/promptSyntax/service/promptsService.test|title=PromptsService listPromptFiles - extensions Contributed file with when clause is filtered inside PromptsService|occurrence=1promptsService.test|titl…promptsService.test|title=PromptsService listPromptFiles - extensions Provider file with when clause is filtered inside PromptsService|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/chat/test/common/promptSyntax/service/promptsService.test|title=PromptsService listPromptFiles - extensions Provider file with when clause is filtered inside PromptsService|occurrence=1promptsService.test|titl…promptFilesLocator.test|title=PromptFilesLocator empty workspace empty filesystem object config value|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/chat/test/common/promptSyntax/utils/promptFilesLocator.test|title=PromptFilesLocator empty workspace empty filesystem object config value|occurrence=1promptFilesLocator.test|…mcpServerRequestHandler.test|title=Workbench - MCP - ServerRequestHandler callTool forwards _meta.traceparent to the JSON-RPC payload (MCP SEP-414)|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/mcp/test/common/mcpServerRequestHandler.test|title=Workbench - MCP - ServerRequestHandler callTool forwards _meta.traceparent to the JSON-RPC payload (MCP SEP-414)|occurrence=1mcpServerRequestHandler.…mcpServerRequestHandler.test|title=Workbench - MCP - ServerRequestHandler should handle error responses|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/mcp/test/common/mcpServerRequestHandler.test|title=Workbench - MCP - ServerRequestHandler should handle error responses|occurrence=1mcpServerRequestHandler.…mcpServerRequestHandler.test|title=Workbench - MCP - ServerRequestHandler should handle server notifications|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/mcp/test/common/mcpServerRequestHandler.test|title=Workbench - MCP - ServerRequestHandler should handle server notifications|occurrence=1mcpServerRequestHandler.…chatEntitlementService.test|title=chatRequiresSetup not completed requires setup|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/services/chat/test/common/chatEntitlementService.test|title=chatRequiresSetup not completed requires setup|occurrence=1chatEntitlementService.t…Focused file · src/vs/platform/telemetry/common/telemetry.ts · 119 LOCcommon/telemetry.ts

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the related-file, concept, and source links on this page while the interactive map is unavailable.

1 > /*--------------------------------------------------------------------------------------------- telemetry.ts ×3
2 > * Copyright (c) Microsoft Corporation. All rights reserved.
3 > * Licensed under the MIT License. See License.txt in the project root for license information.
4 > *--------------------------------------------------------------------------------------------*/
5 >
6 > import { createDecorator } from '../../instantiation/common/instantiation.js';
7 > import { ClassifiedEvent, IGDPRProperty, OmitMetadata, StrictPropertyCheck } from './gdprTypings.js';
8 >
9 > export const ITelemetryService = createDecorator<ITelemetryService>('telemetryService');
10 >
11 > export interface ITelemetryData {
12 > from?: string;
13 > target?: string;
14 > [key: string]: string | unknown | undefined;
15 > }
16 >
17 > export interface ITelemetryService {
18 >
19 > readonly _serviceBrand: undefined;
20 >
21 > readonly telemetryLevel: TelemetryLevel;
22 >
23 > readonly sessionId: string;
24 > readonly machineId: string;
25 > readonly sqmId: string;
26 > readonly devDeviceId: string;
27 > readonly firstSessionDate: string;
28 > readonly msftInternal?: boolean;
29 >
30 > /**
31 > * Whether error telemetry will get sent. If false, `publicLogError` will no-op.
32 > */
33 > readonly sendErrorTelemetry: boolean;
34 >
35 > /**
36 > * @deprecated Use publicLog2 and the typescript GDPR annotation where possible
37 > */
38 > publicLog(eventName: string, data?: ITelemetryData): void;
39 >
40 > /**
41 > * Sends a telemetry event that has been privacy approved.
42 > * Do not call this unless you have been given approval.
43 > */
44 > publicLog2<E extends ClassifiedEvent<OmitMetadata<T>> = never, T extends IGDPRProperty = never>(eventName: string, data?: StrictPropertyCheck<T, E>): void;
45 >
46 > /**
47 > * @deprecated Use publicLogError2 and the typescript GDPR annotation where possible
48 > */
49 > publicLogError(errorEventName: string, data?: ITelemetryData): void;
50 >
51 > publicLogError2<E extends ClassifiedEvent<OmitMetadata<T>> = never, T extends IGDPRProperty = never>(eventName: string, data?: StrictPropertyCheck<T, E>): void;
52 >
53 > setExperimentProperty(name: string, value: string): void;
54 >
55 > /**
56 > * Sets a common property that will be attached to all telemetry events.
57 > * Common properties are added after PII cleaning and cannot be overridden by event data.
58 > */
59 > setCommonProperty(name: string, value: string | boolean): void;
60 > }
61 >
62 > export function telemetryLevelEnabled(service: ITelemetryService, level: TelemetryLevel): boolean {
63 return service.telemetryLevel >= level;
64 }
66 > /**
67 > * Replaces `/` and `\` with `|` in model identifiers to prevent the
68 > * telemetry pipeline from redacting them as file paths.
69 > */
70 > export function escapeModelIdForTelemetry(modelId: string | undefined): string | undefined {
71 return modelId?.replace(/[\/\\]/g, '|');
72 }
74 > export interface ITelemetryEndpoint {
75 > id: string;
76 > aiKey: string;
77 > sendErrorTelemetry: boolean;
78 > }
79 >
80 > export const ICustomEndpointTelemetryService = createDecorator<ICustomEndpointTelemetryService>('customEndpointTelemetryService');
81 >
82 > export interface ICustomEndpointTelemetryService {
83 > readonly _serviceBrand: undefined;
84 >
85 > publicLog(endpoint: ITelemetryEndpoint, eventName: string, data?: ITelemetryData): void;
86 > publicLogError(endpoint: ITelemetryEndpoint, errorEventName: string, data?: ITelemetryData): void;
87 > }
88 >
89 > // Keys
90 > export const currentSessionDateStorageKey = 'telemetry.currentSessionDate';
91 > export const firstSessionDateStorageKey = 'telemetry.firstSessionDate';
92 > export const lastSessionDateStorageKey = 'telemetry.lastSessionDate';
93 > export const machineIdKey = 'telemetry.machineId';
94 > export const sqmIdKey = 'telemetry.sqmId';
95 > export const devDeviceIdKey = 'telemetry.devDeviceId';
96 >
97 > // Configuration Keys
98 > export const TELEMETRY_SECTION_ID = 'telemetry';
99 > export const TELEMETRY_SETTING_ID = 'telemetry.telemetryLevel';
100 > export const TELEMETRY_CRASH_REPORTER_SETTING_ID = 'telemetry.enableCrashReporter';
101 > export const TELEMETRY_OLD_SETTING_ID = 'telemetry.enableTelemetry';
102 >
103 > export const enum TelemetryLevel {
104 > NONE = 0,
105 > CRASH = 1,
106 > ERROR = 2,
107 > USAGE = 3
108 > }
109 >
110 > export const enum TelemetryConfiguration {
111 > OFF = 'off',
112 > CRASH = 'crash',
113 > ERROR = 'error',
114 > ON = 'all'
115 > }
116 >
117 > export interface ICommonProperties {
118 > [name: string]: string | boolean | undefined;
119 > }