DRIVERS-3598 Specify and test getMore span nesting in the OpenTelemetry spec - #1973
Open
blink1073 wants to merge 12 commits into
Open
DRIVERS-3598 Specify and test getMore span nesting in the OpenTelemetry spec#1973blink1073 wants to merge 12 commits into
blink1073 wants to merge 12 commits into
Conversation
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.
DRIVERS-3598
Please complete the following before merging:
clusters).
Context
Command spans must nest under "the corresponding driver operation span", which is unambiguous only while an operation sends a single command. For a cursor the spec never said which operation span a
getMorebelongs to, and no fixture exercisedgetMore; so both readings passed the suite, anddb.mongodb.cursor_idwas asserted absent in all 25 places it appeared.Changes
getMoregets its own operation span, sibling to the cursor-creating operation's span. Driver-internal iteration, where one public API call drains the cursor itself, creates no additional operation spans.getMoreoperation span rather than extending it.db.mongodb.cursor_idraised from SHOULD to MUST and added to operation spans. It holds the id the driver sent for agetMore, even when that reply returns0; it is omitted rather than emitted as0for a cursor-creating command that leaves no cursor open, and omitted for commands that may operate on several cursors at once.cursor_idoutcomes withignoreExtraSpans: false, plus prose tests 3 and 4 for what the unified format cannot express.ignoreExtraSpansapplies at every level of the span tree, without which the tests' negative assertion is not enforceable.Two decisions worth a second opinion
Neither is stated in the design document, so please confirm rather than assume:
getMore <db>.<collection>, following the existing convention of naming operation spans after commands rather than public-API methods. Naming it after the driver's iteration method would vary per driver and make the test unassertable cross-driver.0. This matches the existingfind.ymlandaggregate.ymltests, which omitcursor_idon commands that exhaust in the first batch, and OpenTelemetry's convention of omitting unavailable attributes rather than encoding a sentinel.Testing
Python implementation: mongodb/mongo-python-driver#2964
get_more.jsoncaught a real divergence there on its first run: PyMongo used a single cursor-lifetime operation span, the reading this PR rules out, and passes unmodified now that the driver conforms. Prose tests 3 and 4 are implemented and passing.