Repository navigation
fix(diagnostics): retain longer traces with reader export limits - #681
Merged
Merged
Conversation
nixuuu
marked this pull request as ready for review
November 13, 2026 23:43
This was referenced Nov 16, 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.
The user's 237-second trace filled its 2000-span ring and overwrote 112 sampled operations. Retain up to 10000 numeric samples (720000 B plus 16 B scratch) inside the unchanged separate 4 MiB opt-in trace ceiling. Sampling remains 1/101 operations and at most 100 samples/s; no new payload fields, timer, persistence or automatic collection.
Add an optional
DiagnosticsTraceRequest.max_samplesfield and regenerate contracts. Web/mobile request 10000; absent/zero retains the legacy 2000 export limit through gateway, linked computer and WorkerLink. Export truncation counts as dropped samples without destroying the full local ring. Thus an older linked gateway's strict validator still accepts the result.Paired 30 s local workload after 5 s warmup: two linked desktop gateways, 12 threads each, desktop SSE plus mobile Connect simulation, diagnostics and tracing enabled.
This short idle workload does not fill either ring; it verifies unchanged background work, not a drop reduction. A numeric synthetic workload matching the reported 2112 sampled operations over 237 s retains 2112 spans / 0 drops, versus the legacy export's 2000 spans / 112 drops. Saturated ring tests verify unique IDs, the 4 MiB encoded limit, stop/expiry cleanup and repeated GC plateaus (27 assertions).
Validation: real owner-scoped tracing integration suite 7 passed / 79 assertions, including both export limits through local, linked and worker routes; synthetic retention 9 assertions; memory suite passed. Install, full typecheck, lint, format:check and web build passed. Proto generation committed; gen:check rerun after commit. Full local check:tmp deferred to CI because the shared host is overloaded; focused files ran individually with clean temp directories.
Mobile iOS and Android exports passed. Native inputs unchanged: paired local fingerprints are identical before/after (iOS
74705db3a68907bc28379bb9b1080a227bc0755b, Android7d38be8f5c9bf842d62060c75820a206f99c87e3). Device UI verification remains blocked by the reported device-host error. Request construction changes only; no visible UI/copy changes.Fixes: #590
CI follow-up: the first full run passed 666 tests in the affected shard but failed the memory test's unchanged 2 MiB heap-delta bound. The expanded-ring test now warms a full 12-cycle window, including GC/expiry, before its baseline, and prints all cycle samples on failure. The revised local run passes 27 assertions: final stopped delta 743624 B and purged delta 23480 B. Both the 2 MiB absolute delta and 1 MiB purged plateau bounds remain unchanged; confirmation on CI is pending.