Skip to content

RUBY-3831 Skip OpenTelemetry command spans - backport#3042

Merged
comandeo-mongo merged 1 commit intomongodb:2.23-stablefrom
comandeo-mongo:backport-otel-fix
May 8, 2026
Merged

RUBY-3831 Skip OpenTelemetry command spans - backport#3042
comandeo-mongo merged 1 commit intomongodb:2.23-stablefrom
comandeo-mongo:backport-otel-fix

Conversation

@comandeo-mongo
Copy link
Copy Markdown
Contributor

This is backport of #3038 to 2.23.x

Copilot AI review requested due to automatic review settings May 7, 2026 09:04
@comandeo-mongo comandeo-mongo requested a review from a team as a code owner May 7, 2026 09:04
@comandeo-mongo comandeo-mongo requested a review from jamis May 7, 2026 09:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Backports RUBY-3831 to the 2.23.x line by preventing OpenTelemetry command spans from being created for commands that may contain credentials (and for hello/legacy hello), avoiding potential sensitive data leakage via span attributes like db.query.text.

Changes:

  • Update the OpenTelemetry CommandTracer to short-circuit tracing for sensitive/auth commands and for hello/ismaster/isMaster.
  • Add specs asserting no span/context is created for skipped commands while still yielding and returning the block result.

Reviewed changes

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

File Description
lib/mongo/tracing/open_telemetry/command_tracer.rb Adds sensitive/hello skip logic so no command span is created for these commands.
spec/mongo/tracing/open_telemetry/command_tracer_spec.rb Adds coverage to ensure skipped commands do not create spans/contexts but still execute the command block.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@comandeo-mongo comandeo-mongo merged commit cc2bec4 into mongodb:2.23-stable May 8, 2026
173 checks passed
@comandeo-mongo comandeo-mongo deleted the backport-otel-fix branch May 8, 2026 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants