Repository navigation
Improve MXC execution telemetry and lifecycle correlation - #1575
Richie Gomez (richiemsft) wants to merge 8 commits into
Conversation
Emit execution Start/End events, add lifecycle session correlation and denial-capture mode attribution, and preserve invocation isolation across streaming operations and backend cleanup. Update consent disclosure, event documentation, and regression coverage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9e46bdb3-c7d8-46aa-af26-56f317c36a58
There was a problem hiding this comment.
🟡 Changes recommended
Invocation context is lost across backend thread boundaries, and missing session IDs incorrectly suppress authorized streaming telemetry.
2 open issues
What changed in this PR
This PR adds execution Start/End telemetry and lifecycle-wide session correlation across MXC executors and SDK operations.
Changes:
- Replace
MXC.Executionwith Start/End events and add session IDs and bounded denial-capture modes. - Preserve attribution across streaming-handle operations and persist lifecycle correlation roots.
- Update consent disclosure to version 4, documentation, and regression coverage.
| File | Description |
|---|---|
| tests/scripts/run_telemetry_etw_smoke_test.ps1 | Validate execution pairs, attribution, and consent v4. |
| tests/scripts/run_telemetry_consent_smoke_test.ps1 | Update consent expectations to v4. |
| tests/scripts/run_telemetry_consent_release_test.ps1 | Update release consent checks to v4. |
| src/tools/wxc/src/main.rs | Initialize session attribution and emit execution Start. |
| src/tools/mxc_darwin/src/main.rs | Add the execution Start call. |
| src/tools/lxc/src/main.rs | Add the execution Start call. |
| src/mxc-sdk/tests/wxc_e2e_tests_e2e_telemetry_etw.rs | Check new event names and attribution fields. |
| src/mxc-sdk/src/core/mxc_telemetry/mod.rs | Emit Start/End events and session fields. |
| src/mxc-sdk/src/core/mxc_engine/state_aware.rs | Instrument lifecycle dispatch with session scopes and Start events. |
| src/mxc-sdk/src/core/mxc_engine/mod.rs | Retain streaming-handle attribution during operations and cleanup. |
| src/mxc-sdk/src/core/mxc_common/telemetry/session.rs | Add scoped session and learning-mode context. |
| src/mxc-sdk/src/core/mxc_common/telemetry/mod.rs | Integrate Start/End emission and invocation suppression. |
| src/mxc-sdk/src/core/mxc_common/telemetry/events.rs | Add learning-mode classification and event test support. |
| src/mxc-sdk/src/core/mxc_common/telemetry/correlation_state.rs | Persist late-enabled lifecycle roots and clear stale state. |
| src/mxc-sdk/src/core/mxc_common/telemetry/consent_prompt.rs | Update disclosure text assertions. |
| src/mxc-sdk/src/core/mxc_common/process_util.rs | Extract Windows parent-process and image-path helpers. |
| src/mxc-sdk/src/core/mxc_common/models.rs | Centralize learning-mode capability classification. |
| src/mxc-sdk/src/core/mxc_common/diagnostic.rs | Reuse process helpers for local diagnostics. |
| src/mxc-sdk/src/backends/process_container/common/appcontainer_runner.rs | Reuse the shared capability classifier. |
| src/mxc-sdk/resources/telemetry/consent/en-US.json | Introduce v4 lifecycle-correlation disclosure. |
| sdk/dotnet/Microsoft.Mxc.Sdk.Tests/MxcTelemetryTests.cs | Align .NET consent tests with v4. |
| docs/telemetry.md | Explain execution pairs and lifecycle correlation. |
| docs/development/architecture/telemetry.md | Document event contracts and correlation persistence. |
| docs/development/architecture/telemetry-consent-design.md | Document re-consent and collector migration requirements. |
Review effort: Balanced
Restore complete invocation context across IsolationSession workers and moved streaming handles. Preserve upstream fallback removal and session lifecycle support. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9e46bdb3-c7d8-46aa-af26-56f317c36a58
Align release consent fixtures with resource v4, gate Windows-only attribution readers, and validate cross-process lifecycle correlation with isolated local ETW capture on scheduled IsolationSession hosts. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9e46bdb3-c7d8-46aa-af26-56f317c36a58
Validate the actual lifecycle scenario requests through real CLI dry-runs, with telemetry disabled and a missing-network rejection control, before publishing the test executor artifact. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9e46bdb3-c7d8-46aa-af26-56f317c36a58
Match actual tracerpt XML rather than numeric System task IDs, and exercise the real layout in the offline regression fixture without weakening pair or lifecycle assertions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9e46bdb3-c7d8-46aa-af26-56f317c36a58
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Preserve lifecycle telemetry validation alongside the shared Node integration suite dispatcher. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 08308f81-0ab1-4b64-9efa-f373a119e864
Preserve telemetry session and execution event handling alongside captured MicroVM dispatch. Combine validation artifact guidance and cover captured execution telemetry outcomes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 08308f81-0ab1-4b64-9efa-f373a119e864
There was a problem hiding this comment.
🔵 Needs a closer look
The version-4 consent disclosure and lifecycle telemetry inventory require Privacy/release-owner review, while the CI-wired real-host lifecycle ETW scenario still lacks execution evidence.
No open issues 🎉
Review effort: Balanced
|
Branden Bonaby (@bbonaby), Gudge (@MGudgin), Jeff Whiteside (@jsidewhite) could you take a look? |
Retain IsolationSession lifecycle telemetry alongside the required development SDK integration scenarios and fail-closed suite checks. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 08308f81-0ab1-4b64-9efa-f373a119e864
There was a problem hiding this comment.
🔵 Needs a closer look
The version-4 consent and telemetry disclosures require Privacy and release-owner review, while the cross-process lifecycle ETW scenario lacks execution evidence from an elevated, supported Windows host.
No open issues 🎉
Review effort: Balanced


Description
Improve execution telemetry and correlate events across a container lifecycle.
MXC.ExecutionwithMXC.ExecutionStartandMXC.ExecutionEnd, including SDK streaming/PTY and container lifecycle paths.mxc.session_idto all 11 event families. Reuse the persisted random lifecycle root across executor processes and preserve each streaming handle's attribution across threads and cleanup.mxc.capture_denialsmode to Start/End and share the existing capability classifier with backend diagnostics.Collectors must update filters and queries from
MXC.Executionto the new Start/End names. Start describes a pre-dispatch attempt, not a successful process launch; missing End is not definitive evidence of a crash.The version-4 disclosure remains subject to Privacy and release-owner review before shipping.
References
Fixes #1588. #1517
docs/telemetry.mddocs/development/architecture/telemetry.mddocs/development/architecture/telemetry-consent-design.mdValidation
cargo fmt --all -- --checkcargo test -q -p mxc-sdk --lib telemetry- 274 passed.cargo test -q -p mxc-sdk --lib mxc_engine- 106 passed.cargo test -q -p mxc-sdk --lib --features isolation_session telemetry- 275 passed.exec_stream- 29 passed;owned_thread- 9 passed.cargo clippy -q -p mxc-sdk --lib --tests --features isolation_session -- -D warningscargo clippy -q -p mxc-sdk --lib --tests -- -D warningscargo clippy -q -p wxc --bin wxc-exec -- -D warningsdotnet run --project Microsoft.Mxc.Sdk.Tests\Microsoft.Mxc.Sdk.Tests.csproj -- -class '*MxcTelemetryTests*'- 100 passed.git diff --check.No new VM deployment or live telemetry sends were performed for this submission.
Checklist
Cargo.lock, thedependency-feed-checkcheck passes (see pull request builds)Issue Type
GitHub Actions runs the PR validation build automatically. The ADO pipeline
(
MXC-PR-Build) is the Azure version of the PR pipeline, kept in parity with the GitHubActions build; it runs on merge to
main, and Microsoft reviewers with write access can trigger iton a PR with
/azp run. See pull request builds.If the
dependency-feed-checkcheck fails on a new dependency, the crate must be added tothe feed before the PR can pass. See pull request builds
for the steps.
Microsoft Reviewers: Open in CodeFlow