Implement comprehensive chat session telemetry with GDPR compliance #265606
+566
−13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements comprehensive telemetry tracking for chat session lifecycle events in VS Code, providing valuable insights into session usage patterns while maintaining strict GDPR compliance.
Overview
Prior to this implementation, VS Code's chat functionality had limited telemetry coverage for session management operations. This made it difficult to understand:
Implementation
New Telemetry Events
1.
chatSessionCreated
- Tracks when chat sessions are created or restored2.
chatSessionDisposed
- Tracks when sessions are cleared or disposed3.
chatSessionRestored
- Tracks session restoration from persistent storage4.
chatSessionPersisted
- Tracks session storage operationsGDPR Compliance
All telemetry events follow VS Code's strict GDPR requirements:
SystemMetaData
classification for non-personal system informationFeatureInsight
(usage patterns) orPerformanceAndHealth
(diagnostics)isMeasurement: true
for analyticsPrivacy Protection
The implementation ensures zero collection of sensitive data:
Integration Points
_startSession
,getOrRestoreSession
,clearSession
)writeSession
method with size trackingchatSessionTelemetry.test.ts
validates event emission and data structureBenefits
This telemetry will enable the team to:
Testing
The implementation includes comprehensive test coverage that validates:
All tests follow VS Code's existing testing patterns and integrate with the current test infrastructure.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
electronjs.org
node-gyp
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Created from VS Code via the GitHub Pull Request extension.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.