Repository navigation
fix(tracing): bound local span retention and share provider cache - #1165
Merged
yaozheng-fang merged 2 commits intoOct 13, 2026
Merged
Conversation
yaozheng-fang
approved these changes
Oct 13, 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.
Long-running tracing retained every sampled span and accumulated session mappings indefinitely. Repeated tracer construction also registered another permanent local collector, amplifying retention of large response payloads.
Bound the local cache to 1,024 spans and 16 MiB of estimated data by default, evict old entries, and share one collector per provider. Add configurable limits and an opt-out while preserving span annotations, trace IDs, and delivery to other exporters. Clear/shutdown release cache state, and local dumps contain only retained history. Include regression coverage and bilingual configuration documentation.
Validation: 75 targeted tests passed after synchronization with main; all pre-commit checks passed, including Ruff and secret scanning. Both changed MDX pages compile. The two runtime tests that failed in the first CI run now read session snapshots and pass locally. Extended runtime checks have 84 passed, 2 expected failures, and one log-capture failure also reproduced on the original PR commit. Production memory behavior and the full test suite have not been validated locally.