feat: add WIL-based TraceLogging ETW telemetry (experimental)
📖 Description
Add experimental telemetry support using the tracelogging crate for pure Rust ETW event emission. No C++ shim or WIL dependency required.
- New
mxc_telemetrycrate withdefine_provider!andwrite_event!forMXC.ExecutionandMXC.Errorevents using COMMON_MXC_PARAMS struct fields build.rsgeneratesprovider_def.rswith optionalgroup_idbased onMXC_TELEMETRY_PROVIDER_GROUP_GUIDenv var for internal buildswxc_common::telemetrymodule: config resolution,sanitize_error_message()(strips Windows paths, Unix paths, UNC paths, and URL credentials), event types with boundedFailureReasonenum- Schema, config parser, and SDK types extended with
telemetry.enabledfield - Telemetry callsites in
wxcandlxcbinaries emit execution and error events - Experimental feature: requires
--experimentalflag andtelemetry.enabledin the JSON config - Non-Windows: all telemetry functions compile as no-ops
- Design doc at
docs/telemetry-wil-integration.mdwith architecture, feature comparison table, and GUID override mechanism
Build integration (pipeline GUID substitution, license override script) will follow in a separate PR.
🔗 References
#492
🔍 Validation
Built locally and ran unit tests. Validated that ETW events fire when build configuration is not set to allow telemetry. Validated that telemetry appears as expected in the UTC when telemetry provider is correctly enabled.
✅ Checklist
- [ x] Signed the Contributor License Agreement
- [ x] Linked to an issue
- [ x] Updated documentation (if applicable)
- [ ] Updated Copilot instructions (if build, architecture, or conventions changed)
📋 Issue Type
- [ ] Bug fix
- [ x] Feature
- [ ] Task
Microsoft reviewers: PR builds don't auto-run (ADO policy). Comment /azp run
to start MXC-PR-Build. See docs/pull-requests.md.
Microsoft Reviewers: Open in CodeFlow
Can we just use these:
- https://crates.io/crates/tracelogging
- https://crates.io/crates/tracelogging_dynamic
Follow-up: seed racelogging into the ADO MxcDependencies feed (review item #4)
This PR adds two new transitive crates that resolve from crates.io on GitHub Actions (hence all GH checks are green), but will 401 on the anonymous ADO MxcDependencies feed until an authenticated fetch seeds them:
- racelogging 1.2.4
- racelogging_macros 1.2.3
Both are gated behind [target.'cfg(windows)'.dependencies], so only Windows ADO jobs pull them. The official build uses the separate internal Mxc-Azure-Feed and is unaffected; the fork-PR / Unofficial / Lint / Mac jobs that use the anonymous public feed are the ones that need the seed.
@bbonaby — could you trigger a seeding fetch (or confirm the feed already mirrors these) before this merges, so the ADO MXC-PR-Build pipeline doesn't 401 on the new crates? No code change is required here.
Deferred to a separate PR: docs/schema.md version-table drift (review item #2)
The review flagged that docs/schema.md's supported-version table is out of sync with the canonical schemas/schema-version.json. This drift is pre-existing — this PR only added 3 telemetry-related lines and did not touch the version table — so I'm intentionally not fixing it here to keep the telemetry change focused.
Tracking it as a follow-up doc PR rather than expanding the scope of this one.
I am not convinced MXC, at this point, needs telemetry. With MXC in alpha + the low number of users + an even lower number of events that are sent to Microsoft, the amount of useful events will be super slim. I do not believe any useful decisions can be made from the small number of events sent to Microsoft.