Add POSIX telemetry - #27379
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces cross-platform build support for telemetry by extending the existing Windows ETW telemetry to non-Windows platforms via the 1DS (cpp_client_telemetry) SDK, wiring it through the build scripts and CMake.
Changes:
- Adds a new POSIX telemetry provider implementation using the 1DS SDK and swaps it into the POSIX Env when enabled.
- Extends build and CMake plumbing to fetch/link cpp_client_telemetry on non-Windows and to expose a cross-platform
--use_telemetrybuild flag. - Updates top-level build wrappers and third-party notices for the new dependency.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/ci_build/build_args.py | Moves --use_telemetry to cross-platform args. |
| tools/ci_build/build.py | Always sets -Donnxruntime_USE_TELEMETRY=ON/OFF based on --use_telemetry. |
| onnxruntime/core/platform/windows/telemetry.cc | Include ordering tweak only. |
| onnxruntime/core/platform/posix/telemetry.h | Introduces POSIX telemetry provider interface (1DS). |
| onnxruntime/core/platform/posix/telemetry.cc | Implements POSIX telemetry provider using cpp_client_telemetry. |
| onnxruntime/core/platform/posix/env.cc | Uses PosixTelemetry provider when USE_1DS_TELEMETRY is defined. |
| cmake/onnxruntime_common.cmake | Adds POSIX telemetry sources/defines and links 1DS + system libs when enabled. |
| cmake/onnxruntime_1ds_telemetry.cmake | New helper module for enabling 1DS telemetry on non-Windows. |
| cmake/external/onnxruntime_external_deps.cmake | Fetches cpp_client_telemetry only when telemetry is enabled on non-Windows. |
| cmake/deps.txt | Adds cpp_client_telemetry dependency entry. |
| cmake/CMakeLists.txt | Includes the new 1DS telemetry CMake module. |
| build.sh | Now passes --use_telemetry by default. |
| build.bat | Now passes --use_telemetry by default. |
| ThirdPartyNotices.txt | Adds cpp_client_telemetry license text (and an additional KleidiAi block). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bmehta001
force-pushed
the
bhamehta/posix-telemetry
branch
from
June 11, 2026 06:40
fded7ba to
2f18217
Compare
bmehta001
force-pushed
the
bhamehta/posix-telemetry
branch
from
June 23, 2026 17:14
178e702 to
b0eaeb7
Compare
This was referenced Aug 15, 2026
Open
This was referenced Aug 19, 2026
Closed
This was referenced Aug 25, 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.
Summary
Adds 1DS-backed telemetry to ONNX Runtime on Linux, macOS, Android, and iOS. Windows continues to use its existing ETW provider, with aligned metadata, redaction, and unit-test suppression. WebAssembly remains telemetry-free.
No public ABI is changed.
Behavior and controls
ProcessInfoevent plus low-frequency session, model, execution-provider, error, and aggregate runtime events.popSamplemetadata.RuntimePerf. POSIXEvaluationStart/EvaluationStopare no-ops, andSystemMetricsfollows theRuntimePerfcadence instead of running on every inference.--use_telemetry; directbuild.py/CMake builds can omit it completely.ORT_DISABLE_TELEMETRY=1is a full non-Windows opt-out when set before initialization: no uploader, events, persistent device identifier, or offline cache is created. The decision is latched for the process lifetime.Privacy, safety, and reliability
Build and package integration
cpp-client-telemetryvcpkg port when available, with a pinned FetchContent fallback.Performance
A Release benchmark using
mul_1.onnx, alternating enabled/disabled samples, CPU affinity, isolated caches, and blocked network showed that the original synchronous per-inference 1DS events were too expensive:Network upload remains asynchronous inside 1DS; this change removes serialized SDK intake from each successful
Run().Validation
ProcessInfo,SessionCreationStart,SessionCreation, andSessionCreationEnd, including shared process correlation and platform device identity.