Skip to content

Add POSIX telemetry - #27379

Merged
bmehta001 merged 43 commits into
mainfrom
bhamehta/posix-telemetry
Jul 24, 2026
Merged

Add POSIX telemetry#27379
bmehta001 merged 43 commits into
mainfrom
bhamehta/posix-telemetry

Conversation

@bmehta001

@bmehta001 bmehta001 commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

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

  • Emits one process-level ProcessInfo event plus low-frequency session, model, execution-provider, error, and aggregate runtime events.
  • Uses deterministic session-level sampling so correlated events are retained or dropped together. The current sampling rate is 100%, and retained events carry 1DS popSample metadata.
  • Serializes map-valued metadata deterministically to avoid multiple telemetry values for identical logical data.
  • Aggregates successful inference counts and durations in RuntimePerf. POSIX EvaluationStart/EvaluationStop are no-ops, and SystemMetrics follows the RuntimePerf cadence instead of running on every inference.
  • Native telemetry is compiled only when configured with --use_telemetry; direct build.py/CMake builds can omit it completely.
  • ORT_DISABLE_TELEMETRY=1 is 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.
  • Runtime telemetry APIs suppress non-essential events. ONNX Runtime may already have emitted the minimal initialization event before the API can be called.
  • CI hard-suppresses POSIX telemetry; ORT unit-test processes suppress both POSIX telemetry and Windows ETW.

Privacy, safety, and reliability

  • Desktop builds send a product-salted hash of a locally generated per-user UUID; the raw UUID is never uploaded. Android and iOS retain the platform identity supplied by 1DS.
  • Persistent device identity uses owner-only storage, bounded no-follow reads, dirfd-relative file operations, atomic publication, and serialized corruption repair shared with ONNX Runtime GenAI.
  • Free-text fields scrub filesystem paths and cap payload size without splitting UTF-8 code points.
  • Every complete POSIX telemetry operation - event construction, redaction, property insertion, and SDK emission - is contained by a no-throw boundary. Diagnostic failures are also contained.
  • SDK initialization is transactional: partially created managers are released before configuration teardown, and logger state is published only after setup completes.
  • Logging holds a shared lock while 1DS accepts an event; initialization and shutdown retain exclusive locking. Concurrent logging is not serialized by ORT.
  • Shutdown is configured not to wait for network upload and remains safe during process teardown.

Build and package integration

  • Uses the cpp-client-telemetry vcpkg port when available, with a pinned FetchContent fallback.
  • Links the SDK statically where supported and includes its dependency metadata and third-party notices.
  • Official Linux, macOS, Android, and iOS package configurations enable telemetry.
  • Official Android AARs package and initialize the 1DS Java HTTP transport, including relocated bridge classes and required JNI exports so they can coexist with ONNX Runtime GenAI.
  • Apple framework builds use the platform HTTP transport and static packaging path.
  • An optional tenant-token override is emitted into a generated header rather than a compiler command line or pipeline YAML.

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:

Scenario Before After hot-path removal
Single thread 100.4 us enabled vs 3.5 us disabled (28.7x) Difference below benchmark noise
Eight threads 11.3k enabled vs 306.5k disabled runs/s (96.3% loss) 294.3k enabled vs 295.5k disabled runs/s (0.4% difference)

Network upload remains asynchronous inside 1DS; this change removes serialized SDK intake from each successful Run().

Validation

  • Telemetry-enabled Linux builds and focused environment, redaction, no-throw, and device-ID tests.
  • Windows build/test coverage for shared telemetry helpers and ETW metadata changes.
  • Android AAR build plus x86_64 emulator end-to-end session creation.
  • Backend verification of ProcessInfo, SessionCreationStart, SessionCreation, and SessionCreationEnd, including shared process correlation and platform device identity.
  • Concurrent first-run and corrupted-file device-ID recovery stress tests.
  • Lint, material code review, and repeated Copilot review rounds.

@bmehta001
bmehta001 requested a review from Copilot February 18, 2026 19:04
@bmehta001 bmehta001 self-assigned this Feb 18, 2026
@bmehta001 bmehta001 changed the title Add POSIX telemetry Add POSIX telemetry [DRAFT] Feb 18, 2026

@github-actions github-actions Bot 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.

You can commit the suggested changes from lintrunner.

Comment thread onnxruntime/core/platform/posix/telemetry.cc Outdated
Comment thread onnxruntime/core/platform/posix/telemetry.cc Outdated
Comment thread onnxruntime/core/platform/posix/telemetry.cc Outdated
Comment thread onnxruntime/core/platform/posix/telemetry.cc Outdated
Comment thread onnxruntime/core/platform/posix/telemetry.cc Outdated
Comment thread onnxruntime/core/platform/posix/telemetry.h Outdated
Comment thread onnxruntime/core/platform/posix/telemetry.h Outdated
Comment thread onnxruntime/core/platform/posix/telemetry.h Outdated
Comment thread tools/ci_build/build.py Outdated
Comment thread tools/ci_build/build_args.py Outdated
Comment thread onnxruntime/core/platform/posix/telemetry.cc Fixed
Comment thread onnxruntime/core/platform/posix/telemetry.h Fixed
Comment thread tools/ci_build/build.py Fixed

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

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_telemetry build 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.

Comment thread onnxruntime/core/platform/posix/telemetry.cc Outdated
Comment thread onnxruntime/core/platform/posix/telemetry.h
Comment thread onnxruntime/core/platform/posix/telemetry.cc
Comment thread onnxruntime/core/platform/posix/telemetry.cc Outdated
Comment thread onnxruntime/core/platform/posix/telemetry.cc Outdated
Comment thread onnxruntime/core/platform/posix/telemetry.cc Outdated
Comment thread onnxruntime/core/platform/posix/telemetry.cc Outdated
Comment thread build.bat Outdated
Comment thread ThirdPartyNotices.txt Outdated
Comment thread cmake/external/onnxruntime_external_deps.cmake Outdated

@github-actions github-actions Bot 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.

You can commit the suggested changes from lintrunner.

Comment thread onnxruntime/core/platform/posix/telemetry.h Outdated
@bmehta001
bmehta001 requested a review from a team as a code owner March 5, 2026 10:07
@bmehta001
bmehta001 force-pushed the bhamehta/posix-telemetry branch from fded7ba to 2f18217 Compare June 11, 2026 06:40
@bmehta001
bmehta001 force-pushed the bhamehta/posix-telemetry branch from 178e702 to b0eaeb7 Compare June 23, 2026 17:14
@bmehta001
bmehta001 requested a review from Copilot June 23, 2026 17:59

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

Copilot reviewed 18 out of 18 changed files in this pull request and generated 5 comments.

Comment thread onnxruntime/core/platform/posix/telemetry.cc Outdated
Comment thread build.sh Outdated
Comment thread cmake/onnxruntime_1ds_telemetry.cmake Outdated
Comment thread onnxruntime/core/platform/posix/telemetry.h
Comment thread onnxruntime/core/platform/posix/telemetry.cc

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

Copilot reviewed 18 out of 18 changed files in this pull request and generated 5 comments.

Comment thread onnxruntime/core/platform/posix/telemetry.cc Outdated
Comment thread onnxruntime/core/platform/posix/telemetry.cc Outdated
Comment thread cmake/onnxruntime_1ds_telemetry.cmake Outdated
Comment thread cmake/onnxruntime_common.cmake
Comment thread ThirdPartyNotices.txt

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

Copilot reviewed 18 out of 18 changed files in this pull request and generated 5 comments.

Comment thread onnxruntime/core/platform/posix/telemetry.h
Comment thread onnxruntime/core/platform/posix/telemetry.cc
Comment thread onnxruntime/core/platform/posix/telemetry.cc
Comment thread build.sh Outdated
Comment thread cmake/vcpkg.json

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

Copilot reviewed 18 out of 18 changed files in this pull request and generated 6 comments.

Comment thread build.sh Outdated
Comment thread onnxruntime/core/platform/posix/telemetry.cc
Comment thread onnxruntime/core/platform/posix/telemetry.cc
Comment thread onnxruntime/core/platform/posix/telemetry.cc Outdated
Comment thread onnxruntime/core/platform/windows/telemetry.cc
Comment thread onnxruntime/core/platform/posix/device_id.cc Outdated

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

Copilot reviewed 18 out of 18 changed files in this pull request and generated 5 comments.

Comment thread build.sh Outdated
Comment thread onnxruntime/core/platform/posix/telemetry.cc Outdated
Comment thread onnxruntime/core/platform/posix/env.cc Outdated
Comment thread cmake/vcpkg-configuration.json
Comment thread cmake/onnxruntime_1ds_telemetry.cmake Outdated

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

Copilot reviewed 18 out of 18 changed files in this pull request and generated 7 comments.

Comment thread build.sh Outdated
Comment thread onnxruntime/core/platform/posix/telemetry.cc Outdated
Comment thread onnxruntime/core/platform/posix/telemetry.cc Outdated
Comment thread onnxruntime/core/platform/posix/telemetry.cc Outdated
Comment thread onnxruntime/core/platform/posix/telemetry.cc Outdated
Comment thread onnxruntime/core/platform/posix/telemetry.cc Outdated
Comment thread onnxruntime/core/platform/posix/telemetry.cc Outdated
@bmehta001
bmehta001 requested a review from Copilot June 23, 2026 20:06
Prevent relative environment paths from redirecting telemetry state into the working directory. Bind device ID operations to a validated owner-only directory descriptor and serialize corrupted-file repair with OGA so concurrent processes converge on one persistent ID.

Files changed:
- onnxruntime/core/platform/posix/device_id.cc: validate absolute storage paths, use dirfd-relative I/O, and lock corruption repair.
- onnxruntime/test/platform/posix/device_id_test.cc: cover XDG handling, symlink rejection, and corruption recovery.
- cmake/onnxruntime_unittests.cmake: include POSIX device ID tests only in telemetry-enabled desktop builds.

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

Copilot-Session: 5a640c3d-b813-4671-84cf-ad98db91b480

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

Copilot reviewed 59 out of 59 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

onnxruntime/core/platform/telemetry_environment.h:107

  • The comment claims ORT_TELEMETRY_DISABLED is an opt-out that is "honored on every platform", but WindowsTelemetry does not consult this env var (and the public docs in this PR describe the env-var opt-out as non-Windows-only). This is misleading for future maintainers; either implement env-var handling on Windows or narrow the comment to the non-Windows (1DS) provider.

Comment thread onnxruntime/test/platform/telemetry_redaction_test.cc Outdated
Keep 1DS configuration and manager ownership local until logger setup and context decoration complete. Any early return or exception now releases the pending manager before its configuration is destroyed, leaving global telemetry state empty and retryable.

Files changed:
- onnxruntime/core/platform/posix/telemetry.cc: guard and atomically publish fully initialized SDK state.
- onnxruntime/test/platform/telemetry_redaction_test.cc: remove the duplicated word reported in review.

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

Copilot-Session: 5a640c3d-b813-4671-84cf-ad98db91b480

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

Copilot reviewed 59 out of 59 changed files in this pull request and generated 2 comments.

Comment thread onnxruntime/core/platform/posix/telemetry.cc
Comment thread onnxruntime/core/platform/posix/telemetry.cc
A Windows environment value can grow between the size query and read. Retry with the returned required size so CI, unit-test, and POSIX opt-out detection do not silently treat a concurrently changed value as unset; also clarify that Windows ETW intentionally retains separate controls.

Files changed:
- onnxruntime/core/platform/telemetry_environment.h: retry resized values and correct platform-specific opt-out wording.

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

Copilot-Session: 5a640c3d-b813-4671-84cf-ad98db91b480
Report 0 when POSIX physical memory cannot be determined, matching Windows and OGA instead of emitting an invalid negative megabyte count.

Files changed:
- onnxruntime/core/platform/posix/telemetry.cc: use 0 as the total-memory failure sentinel.

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

Copilot-Session: 5a640c3d-b813-4671-84cf-ad98db91b480

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

Copilot reviewed 59 out of 59 changed files in this pull request and generated 2 comments.

Comments suppressed due to low confidence (1)

onnxruntime/core/platform/windows/telemetry.cc:265

  • Telemetry suppression in CI appears inconsistent with the new cross-platform suppression policy. telemetry_environment.h documents CI-based suppression, and PosixTelemetry::Initialize() returns early when IsRunningInCI(), but WindowsTelemetry only checks IsRunningUnitTests(). This means a CI job that happens to have an ETW trace session could still record ORT events, contradicting the stated hard-suppression behavior.

Comment thread tools/ci_build/gen_def.py
Comment thread tools/ci_build/gen_def.py
Include the provider or extra symbol file path in duplicate-export failures so multi-file Android and provider builds identify the actionable input immediately.

Files changed:
- tools/ci_build/gen_def.py: add source-file context to both duplicate checks.

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

Copilot-Session: 5a640c3d-b813-4671-84cf-ad98db91b480

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

Copilot reviewed 59 out of 59 changed files in this pull request and generated no new comments.

Bring in current generated operator documentation and upstream fixes without rewriting the reviewed branch history.

Files changed: merge origin/main into bhamehta/posix-telemetry.

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

Copilot-Session: 5a640c3d-b813-4671-84cf-ad98db91b480
tianleiwu
tianleiwu previously approved these changes Jul 23, 2026

@tianleiwu tianleiwu 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.

LGTM, as long as we can apply #29843 before or after merging this PR.

bmehta001 and others added 4 commits July 23, 2026 17:58
ORT_TELEMETRY_DISABLED implied a complete opt-out even though the provider still emits ProcessInfo. Rename it to ORT_MINIMAL_TELEMETRY and make detailed-versus-minimal state explicit so the environment and runtime controls match the documented behavior.

Files changed:
- docs/Privacy.md: describe complete build-time disable and runtime minimal mode.
- onnxruntime/core/platform/telemetry_environment.h: expose the minimal-mode environment contract.
- onnxruntime/core/platform/posix/telemetry.h: rename state around detailed and environment-selected minimal modes.
- onnxruntime/core/platform/posix/telemetry.cc: apply and preserve explicit minimal-mode state.
- onnxruntime/test/platform/telemetry_environment_test.cc: cover the renamed variable and mode precedence.

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

Copilot-Session: 5a640c3d-b813-4671-84cf-ad98db91b480
Restore ORT_TELEMETRY_DISABLED and the prior telemetry state naming so Tianlei's full opt-out PR can be merged without conflicting with a parallel environment-variable redesign.

Files changed:
- docs/Privacy.md
- onnxruntime/core/platform/telemetry_environment.h
- onnxruntime/core/platform/posix/telemetry.h
- onnxruntime/core/platform/posix/telemetry.cc
- onnxruntime/test/platform/telemetry_environment_test.cc

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

Copilot-Session: 5a640c3d-b813-4671-84cf-ad98db91b480
### Description

Makes `ORT_TELEMETRY_DISABLED` a **full** telemetry opt-out on the
non-Windows (1DS) provider. Previously, setting the environment variable
only flipped `enabled_ = false` while `Initialize()` still created the
1DS uploader, wrote the persistent device-id file to disk, and let
`LogProcessInfo()` upload a one-shot `ProcessInfo` event (it only
checked `logger_ != nullptr`, not `IsEnabled()`). So a user who
explicitly opted out still got an on-disk identifier and a network
upload.

With this change, the env-var opt-out is treated like CI / unit-test
suppression: the provider returns early before creating the uploader, so
**nothing** is initialized, persisted, or sent.

### Key Changes

| File | Change |
|---|---|
| `onnxruntime/core/platform/telemetry_environment.h` |
`ShouldSuppressTelemetry()` now also returns true for
`IsTelemetryDisabledByEnvVar()`, making it the single "collect nothing"
gate. |
| `onnxruntime/core/platform/posix/telemetry.cc` | `Initialize()`
collapses the CI/unit-test and env-var checks into one early return on
`ShouldSuppressTelemetry()`. When set, no `LogManager`/uploader is
created, `DeviceId::GetValue()` is never called (no device-id file), and
`LogProcessInfo()` returns early (no upload). `env_disabled_` is still
latched so the runtime `EnableTelemetryEvents()` API cannot re-enable
it. `LogProcessInfo()` comment updated. |
| `docs/Privacy.md` | Documents the env-var as a full opt-out: no
uploader, no init event, no persistent device id, latched for the
process lifetime. |
| `onnxruntime/test/platform/telemetry_environment_test.cc` | Adds
assertions that `ShouldSuppressTelemetry()` is true when
`ORT_TELEMETRY_DISABLED` is set. |

### Motivation and Context

Addresses review feedback on #27379 (the "opt-out asymmetry" thread): an
explicit `ORT_TELEMETRY_DISABLED=1` should leave no on-disk identifier
and send nothing, rather than only suppressing usage events while still
emitting an initialization heartbeat. The runtime API-based disable
(`DisableTelemetryEvents()`) is unchanged and may still emit a minimal
init event, matching the Windows ETW model.

### Testing

- `TelemetryEnvironmentTest.EnvVarOptOut` now asserts full suppression
via `ShouldSuppressTelemetry()`.
- Verify on a non-Windows telemetry build that with
`ORT_TELEMETRY_DISABLED=1`: no `onnxruntime.db`/`deviceid` file is
created under the cache dir, and no `ProcessInfo` event is uploaded.
Rename the non-Windows full opt-out to ORT_DISABLE_TELEMETRY and replace partial-mode policy helpers with one process-lifetime suppression latch. This keeps uploader, events, and device identity disabled across ORT reinitialization while leaving the runtime API as the separate reversible control for non-essential events.

Files changed:
- docs/Privacy.md: distinguish full disable from runtime event suppression.
- onnxruntime/core/platform/telemetry_environment.h: read ORT_DISABLE_TELEMETRY and remove obsolete policy helpers.
- onnxruntime/core/platform/posix/telemetry.h: consolidate suppression state.
- onnxruntime/core/platform/posix/telemetry.cc: latch all full-suppression reasons and simplify runtime enable behavior.
- onnxruntime/test/platform/telemetry_environment_test.cc: cover the renamed full opt-out.

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

Copilot-Session: 5a640c3d-b813-4671-84cf-ad98db91b480

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

Copilot reviewed 59 out of 59 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (2)

onnxruntime/core/platform/posix/telemetry.cc:225

  • EventBuilder::AddStringMap serializes an std::unordered_map by iterating it directly, which makes the emitted string nondeterministic across runs. For telemetry, this can inflate cardinality and reduce aggregation usefulness for the same logical map contents. Consider sorting by key first to make the output stable.
  // Helper for string map
  EventBuilder& AddStringMap(const char* key, const std::unordered_map<std::string, std::string>& map) {
    if (!map.empty()) {
      std::string result;
      bool first = true;

onnxruntime/core/platform/posix/telemetry.cc:240

  • EventBuilder::AddBatchSizeDurations builds a string from an unordered_map, so the output order can change across runs for identical input. For telemetry aggregation/debugging it’s usually preferable to keep this deterministic (e.g., sort by batch size).
  // Helper for batch size duration map
  EventBuilder& AddBatchSizeDurations(const std::unordered_map<int64_t, long long>& durations) {
    std::string result;
    for (const auto& [batch_size, duration] : durations) {
      if (!result.empty()) {

Comment thread onnxruntime/core/platform/posix/telemetry.cc
Sort map entries by key before converting them to string-valued telemetry fields so logically identical model metadata, opset maps, and batch durations do not produce different values from unordered-map iteration order.

Files changed:
- onnxruntime/core/platform/posix/telemetry.cc: share deterministic key ordering across all map serializers.

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

Copilot-Session: 5a640c3d-b813-4671-84cf-ad98db91b480

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

Copilot reviewed 59 out of 59 changed files in this pull request and generated no new comments.

Document that the initialization event may precede API-based suppression on every telemetry-enabled platform, while Windows ETW records events only when a trace session is collecting.

Files changed:
- docs/Privacy.md: align API-disable wording across POSIX and Windows telemetry.

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

Copilot-Session: 5a640c3d-b813-4671-84cf-ad98db91b480
Use high-level language for the initialization event that may remain after API-based suppression.

Files changed:
- docs/Privacy.md: describe the remaining minimal initialization event concisely.

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

Copilot-Session: 5a640c3d-b813-4671-84cf-ad98db91b480
State that the minimal initialization event may precede API-based telemetry suppression.

Files changed:
- docs/Privacy.md: preserve the initialization timing detail.

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

Copilot-Session: 5a640c3d-b813-4671-84cf-ad98db91b480
Allow scrubbed telemetry strings, including error messages, to retain up to 2,000,000 bytes while preserving path redaction and UTF-8 boundary safety.

Files changed:
- onnxruntime/core/platform/telemetry_redaction.h: raise the shared scrubbed-string cap.
- onnxruntime/test/platform/telemetry_redaction_test.cc: exercise truncation at the new boundary.

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

Copilot-Session: 5a640c3d-b813-4671-84cf-ad98db91b480
Use the revised 40,960-byte cap while retaining path redaction and UTF-8-safe truncation.

Files changed:
- onnxruntime/core/platform/telemetry_redaction.h: set the scrubbed-string limit to 40,960 bytes.

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

Copilot-Session: 5a640c3d-b813-4671-84cf-ad98db91b480
tianleiwu
tianleiwu previously approved these changes Jul 24, 2026
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.

9 participants