Compress large telemetry properties with gzip chunked columns - #327490
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds gzip/base64 compression and chunking for oversized telemetry properties across Agent Host and Copilot extension telemetry paths.
Changes:
- Introduces asynchronous compressed property multiplexing.
- Updates telemetry senders and routers for asynchronous processing.
- Adds compression and round-trip tests.
Show a summary per file
| File | Description |
|---|---|
agentHostTelemetryReporter.test.ts |
Updates reporter tests for async compression. |
agentHostRepoInfoTelemetry.test.ts |
Updates reporter mocks to async. |
agentHostGitHubTelemetryRouter.test.ts |
Tests compressed routing and round-tripping. |
agentHostTelemetryReporter.ts |
Compresses restricted telemetry properties. |
agentHostRestrictedTelemetry.ts |
Implements Agent Host gzip chunking. |
agentHostGitHubTelemetryRouter.ts |
Makes telemetry routing asynchronous. |
telemetryServiceImpl.ts |
Registers the Node gzip compressor. |
telemetry.spec.ts |
Adds compression behavior tests. |
telemetry.ts |
Implements shared compressed multiplexing. |
chatStream.ts |
Sends multiplexed telemetry asynchronously. |
multiFileEditQualityTelemetry.ts |
Adapts edit telemetry to async multiplexing. |
applyPatchTool.tsx |
Adapts patch telemetry to async multiplexing. |
abstractReplaceStringTool.tsx |
Adapts replacement telemetry to async multiplexing. |
codeMapper.ts |
Adapts successful-edit telemetry. |
repoInfoTelemetry.ts |
Adapts repository telemetry. |
chatMLFetcher.ts |
Adapts tool-option telemetry. |
nextEditProviderTelemetry.ts |
Adapts next-edit telemetry. |
continuousEnhancedTelemetrySender.ts |
Adapts continuous telemetry. |
Review details
- Files reviewed: 18/18 changed files
- Comments generated: 4
- Review effort level: Medium
# Conflicts: # src/vs/platform/agentHost/node/agentHostGitHubTelemetryRouter.ts # src/vs/platform/agentHost/node/agentHostTelemetryReporter.ts # src/vs/platform/agentHost/node/copilot/copilotAgent.ts # src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts # src/vs/platform/agentHost/test/node/agentHostGitHubTelemetryRouter.test.ts # src/vs/platform/agentHost/test/node/agentHostTelemetryReporter.test.ts
vijayupadya
marked this pull request as ready for review
July 27, 2026 17:18
zhichli
previously approved these changes
Jul 27, 2026
vijayupadya
marked this pull request as draft
July 27, 2026 18:02
# Conflicts: # src/vs/platform/agentHost/node/agentHostTelemetryReporter.ts # src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts # src/vs/platform/agentHost/test/node/agentHostTelemetryReporter.test.ts
vijayupadya
marked this pull request as ready for review
July 27, 2026 19:16
vijayupadya
enabled auto-merge (squash)
July 27, 2026 19:33
zhichli
approved these changes
Jul 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes https://github.com/microsoft/vscode-internalbacklog/issues/8434
What
Adds gzip + base64 compression for oversized telemetry properties in both the Copilot extension and the agent host, replacing the previous plain string-splitting for known-large fields.
When a property exceeds
MAX_PROPERTY_LENGTH(8192 chars) — or is one of the always-compressed keys (messagesJson,diffsJSON) — the original column now carries only the first uncompressed 8192-char slice, and the full value is gzip-compressed, base64-encoded, and emitted across<key>Chunk,<key>Chunk_2, … columns (up toMAX_CONCATENATED_PROPERTIES). Values under the limit that aren't force-compressed are unchanged, and when no compressor is available the code falls back to the original plain continuation family.Why
Large prompt/message/diff payloads previously inflated telemetry volume as raw split strings. Compressing them significantly reduces the emitted size while keeping a uniform, backend-readable chunk layout.
How
multiplexPropertiesis now async and awaits a pluggable compressor. The extension registers agzip(viautil.promisify(zlib.gzip)) + base64 compressor throughsetTelemetryPropertyCompressor; the agent host uses the same approach viacompressTelemetryValue.void multiplexProperties(...).then(send).catch(() => { /* best-effort telemetry */ })) so gzip runs off the event loop and never blocks hot paths (request dispatch, tool calls, inline edits).Testing
telemetry.spec.tscompression tests to async and added coverage for the chunked-column layout.agentHostGitHubTelemetryRouter,agentHostRepoInfoTelemetry,agentHostTelemetryReporter) for the async flow.