Skip to content

Pause telemetry on metered connections - #331685

Closed
Dmitriy Vasyura (dmitrivMS) wants to merge 3 commits into
mainfrom
dev/dmitriv/metered-connections-fixes
Closed

Dmitriy Vasyura (dmitrivMS) wants to merge 3 commits into
mainfrom
dev/dmitriv/metered-connections-fixes

Conversation

@dmitrivMS

@dmitrivMS Dmitriy Vasyura (dmitrivMS) commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator
  • propagate the renderer's initial metered-connection state to the main and shared processes
  • pause workbench, main-process, shared-process, and custom-endpoint telemetry while the connection is metered
  • suspend queued 1DS transport work while metered and resume it when the connection becomes unmetered
  • skip shared-process and custom-endpoint shutdown flushes while metered
  • prevent experiment-buffered telemetry from flushing after the connection becomes metered
  • add regression coverage for initial-state propagation, telemetry IPC, transport pause/resume, and metered shutdown

Fixes #297362

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings August 19, 2026 18:33
@dmitrivMS Dmitriy Vasyura (dmitrivMS) added telemetry Telemetry system issues network Network related issues labels Aug 19, 2026
@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

Robo (@deepak1556)

Matched files:

  • src/vs/code/electron-main/app.ts
  • src/vs/code/electron-utility/sharedProcess/sharedProcessMain.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Pauses telemetry event submission when VS Code detects a metered connection.

Changes:

  • Propagates initial metered state across Electron processes.
  • Gates standard and custom-endpoint telemetry.
  • Drops experiment-buffered events when flushing while metered.
Show a summary per file
File Description
src/vs/workbench/services/telemetry/electron-browser/telemetryService.ts Passes metered state to workbench telemetry.
src/vs/platform/telemetry/test/browser/telemetryService.test.ts Tests dropping direct and buffered events.
src/vs/platform/telemetry/node/customEndpointTelemetryService.ts Gates custom-endpoint telemetry.
src/vs/platform/telemetry/common/telemetryService.ts Prevents buffered-event flushing while metered.
src/vs/platform/meteredConnection/test/electron-browser/meteredConnectionService.test.ts Tests initial state propagation.
src/vs/platform/meteredConnection/electron-browser/meteredConnectionService.ts Sends initial browser state to the main process.
src/vs/code/electron-utility/sharedProcess/sharedProcessMain.ts Wires metered state into shared-process telemetry.
src/vs/code/electron-main/app.ts Wires metered state into main-process telemetry.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 8/8 changed files
  • Comments generated: 3
  • Review effort level: Balanced

Comment thread src/vs/platform/telemetry/node/customEndpointTelemetryService.ts
Comment thread src/vs/code/electron-utility/sharedProcess/sharedProcessMain.ts Outdated
@dmitrivMS
Dmitriy Vasyura (dmitrivMS) marked this pull request as draft August 19, 2026 18:46
auto-merge was automatically disabled August 19, 2026 18:46

Pull request was converted to draft

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dmitrivMS
Dmitriy Vasyura (dmitrivMS) requested a balanced review from Copilot August 20, 2026 22:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review details

  • Files reviewed: 14/14 changed files
  • Comments generated: 0 new
  • Review effort level: Balanced

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Code changes are clean and well-structured.

Dmitriy Vasyura (dmitrivMS) added a commit that referenced this pull request Sep 18, 2026
Fold #331685 into the native metered implementation. Wait for initial network state, pause queued 1DS batches and retries, suppress metered shutdown sends, and update running debugger telemetry children without waking idle ones.

Drop known-metered events before experiment buffering. Default metered auto-detection to Insiders only, with no experiment override.

Fixes #297362

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dmitrivMS

Copy link
Copy Markdown
Collaborator Author

Superseded by #331897, which now includes these desktop telemetry fixes in 2f9e41f and includes Fixes #297362.

The integration adapts the fixes to native whenInitialized readiness, covers real 1DS batching/retries and metered shutdown, forwards state to debugger telemetry children without waking idle processes, and fixes the known-metered experiment-buffer edge case. The old renderer detector changes are superseded by native detection.

Local validation passed: 81 focused tests, 15 telemetry compatibility tests, client type-check, and hygiene/ESLint. Additional Agent Host, CLI, and browser collectors are tracked separately in #336679.

Closing this PR in favor of the consolidated implementation; the source branch is retained.

@dmitrivMS

Copy link
Copy Markdown
Collaborator Author

The combined work has now been split for review. The replacement for this PR is #336922, stacked directly on the native metered service PR #331897. #336922 owns the telemetry implementation and the closing link for #297362; #331897 intentionally has no telemetry-metered coupling until that child is applied. This superseded PR remains closed and its branch is retained.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

network Network related issues telemetry Telemetry system issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Metered connection: Telemetry connections

3 participants