-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Minor - P4
-
Affects Version/s: None
-
Component/s: None
-
None
-
None
-
Fully Compatible
-
Ruby Drivers
-
Not Needed
-
None
-
None
-
None
-
None
-
None
-
None
Command spans take db.mongodb.server_connection_id from the server description, not from the connection the command ran on. Each new pooled connection's handshake updates the server description, so it holds the id of whichever connection connected last. When a command runs on an older connection, its span reports another connection's id. Command monitoring already uses the connection's own description and reports the right one.
Repro (OpenTelemetry SDK installed and configured, local replica set):
client = Mongo::Client.new(uri, tracing:
{ enabled: true })
pool = client.cluster.next_primary.pool
first = pool.check_out
second = pool.check_out
pool.check_in(second)
pool.check_in(first) # the next command runs on first
client[:c].find.first
The find span has the server_connection_id of second, while the CommandStarted event for the same find has the id of first (19823 and 19822 in one run).
- related to
-
RUBY-3952 Benchmark OpenTelemetry support
-
- Closed
-