Skip to content

telemetry: respect native metered connection state - #336922

Draft
Dmitriy Vasyura (dmitrivMS) wants to merge 1 commit into
dev/dmitriv/use-vscode-meteredfrom
dev/dmitriv/metered-telemetry
Draft

Dmitriy Vasyura (dmitrivMS) wants to merge 1 commit into
dev/dmitriv/use-vscode-meteredfrom
dev/dmitriv/metered-telemetry

Conversation

@dmitrivMS

Copy link
Copy Markdown
Collaborator

Fixes #297362

Stack

Stacked directly on #331897 (dev/dmitriv/use-vscode-metered). This PR contains only the telemetry portion of the original combined change and does not depend on the Settings Sync, plugin, or extensions-workbench sibling PRs. Merge the primary PR first, then retarget this PR to main.

Changes

  • Restore the pre-existing core/browser telemetry dependency on metered state and the meteredConnectionStateChange event/wiring, which the primary PR deliberately removes.
  • Integrate the fixes from superseded Pause telemetry on metered connections #331685 using native whenInitialized readiness, including silent initial IPC snapshots.
  • Gate main/workbench telemetry and the shared-process collector; pause queued 1DS batches and retries while metered, resume when unmetered, and suppress metered shutdown sends.
  • Forward connection state to running debugger/custom-endpoint telemetry children without waking idle children; manage their service/client lifetimes.
  • Prevent startup/experiment buffering from bypassing metered suppression.

Additional Agent Host, CLI, and browser-local collector work remains tracked separately in #336679.

Validation

  • 91 targeted tests passed, including real 1DS batching/retry tests with an intercepted transport, telemetry IPC, custom-endpoint lifecycle, telemetry compatibility, and native metered service tests.
  • Client type-check, targeted transpilation, and staged-file hygiene/ESLint passed.
  • Applying all four disjoint sibling diffs to the primary branch exactly reconstructs the original combined PR tree.

Stack on the native metered service PR. Restore metered state-change instrumentation and existing telemetry dependencies removed from the primary branch, then gate startup, queued 1DS transport, retries and debugger telemetry on native readiness and connection state.

Fixes #297362

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

Copy link
Copy Markdown
Collaborator Author

Review feedback carried over from the primary PR

After splitting #331897, these two findings belong to this telemetry PR. They are being resolved on the primary PR only because that code is no longer in its scope; the underlying findings are not being marked fixed.

  • Preserve metered classification for buffered startup events. If a definitive metered state is observed while the initial IPC snapshot is pending, followed by an unmetered state before initialization finishes, events generated during the metered interval can be sent at flush time. Preserve their enqueue-time classification or otherwise fail closed, with coverage for that transition sequence. Original review thread.
  • Do not lose startup telemetry before the shared metered snapshot arrives. Main-process buffered logs can reach the shared collector before its unmetered snapshot is applied, bypassing the shared telemetry-service buffer and being dropped by the still-paused appender. Gate incoming appender calls on shared readiness, recheck metered state, and cover cross-process startup ordering. Original review thread.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant