Repository navigation
RUBY-3952 Skip span work for spans with invalid contexts - #3123
Merged
comandeo-mongo merged 1 commit intoOct 29, 2026
Merged
Conversation
With no OpenTelemetry SDK installed and no valid parent, the API returns spans whose context is invalid. They cannot be made current, recorded or propagated, but the tracers still entered with_span, built the result attributes and finished them for every operation and command. Return before any of that, as the OpenTelemetry spec's performance guidelines recommend.
jamis
approved these changes
Oct 29, 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.
When tracing is enabled but no OpenTelemetry SDK is installed, every span the API returns has an invalid context. The driver still made each one current, processed the result and finished it. This returns early for those spans in both tracers, as the guidelines in mongodb/specifications#1986 recommend. It is the first of several small PRs that replace #3122.
Jira: https://jira.mongodb.org/browse/RUBY-3952