Skip to content

RUBY-3952 Add no more to spans that are not recording - #3124

Open
comandeo-mongo wants to merge 1 commit into
mongodb:masterfrom
comandeo-mongo:3952-otel-recording-gate-pr
Open

comandeo-mongo wants to merge 1 commit into
mongodb:masterfrom
comandeo-mongo:3952-otel-recording-gate-pr

Conversation

@comandeo-mongo

Copy link
Copy Markdown
Contributor

When the sampler drops a span, the driver still built every attribute and recorded the outcome on it, and the SDK threw all of it away. Spans now start with the small set of attributes the OpenTelemetry spec recommends, get the rest only when they are recording, and record status, error attributes and exceptions only when recording. A dropped span is still made current, so nesting and context propagation are unchanged. Recorded spans look the same as before. Follows #3123.

Jira: https://jira.mongodb.org/browse/RUBY-3952

Spans the sampler drops are still made current, so that nested spans
stay nested and their context is propagated, but the tracers also built
every attribute and recorded the outcome on them, all of which the SDK
discards. Pass only the cheap attributes the OpenTelemetry spec
recommends at creation, set the rest once the span is known to record,
and record the outcome only on recording spans.
@comandeo-mongo
comandeo-mongo marked this pull request as ready for review October 29, 2026 15:26
@comandeo-mongo
comandeo-mongo requested a review from a team as a code owner October 29, 2026 15:26
@comandeo-mongo
comandeo-mongo requested a review from jamis October 29, 2026 15:26

This branch has not been deployed

No deployments
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.

1 participant