Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Java MongoDB conformance across synchronous, legacy async, and Reactive Streams drivers using both Java agent and library instrumentation.
Changes:
- Adds a pinned MongoDB backend with deterministic fixtures and tests.
- Adds shared Java workloads and launchers for three driver APIs.
- Adds conformance expectations, coverage snapshots, documentation, and Renovate support.
Reviewed changes
Copilot reviewed 52 out of 52 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
tools/database/runner/tests/test_database_session.py |
Tests MongoDB cleanup on failure. |
tools/database/runner/tests/test_database_model.py |
Verifies registry classification. |
tools/database/runner/tests/test_database_coverage.py |
Tests MongoDB span refinement. |
tools/database/runner/tests/test_database_backends.py |
Tests backend lifecycle and packaging. |
tools/database/runner/src/database_conformance/mongodb.js |
Creates deterministic MongoDB fixtures. |
tools/database/runner/src/database_conformance/_mongodb.py |
Defines the MongoDB container backend. |
tools/database/runner/src/database_conformance/_coverage.py |
Adds MongoDB span classification. |
tools/database/runner/src/database_conformance/__init__.py |
Registers the MongoDB backend. |
tools/database/runner/README.md |
Documents MongoDB runner support. |
scenarios/database/README.md |
Documents MongoDB scenarios. |
scenarios/database/java/shared/mongodb/sync/scenarios/src/main/java/io/opentelemetry/conformance/database/mongodb/sync/MongoSyncScenario.java |
Implements synchronous workloads. |
scenarios/database/java/shared/mongodb/sync/scenarios/build.gradle.kts |
Configures the sync workload. |
scenarios/database/java/shared/mongodb/sync/opentelemetry-library/src/main/java/MongoSyncLibraryScenario.java |
Launches sync library instrumentation. |
scenarios/database/java/shared/mongodb/sync/opentelemetry-library/build.gradle.kts |
Adds sync library dependencies. |
scenarios/database/java/shared/mongodb/sync/opentelemetry-javaagent/src/main/java/MongoSyncJavaagentScenario.java |
Launches sync agent instrumentation. |
scenarios/database/java/shared/mongodb/sync/opentelemetry-javaagent/build.gradle.kts |
Configures the sync agent. |
scenarios/database/java/shared/mongodb/support/src/main/java/io/opentelemetry/conformance/database/mongodb/MongoContract.java |
Defines shared connection and fixture values. |
scenarios/database/java/shared/mongodb/support/build.gradle.kts |
Configures shared MongoDB support. |
scenarios/database/java/shared/mongodb/reactive/scenarios/src/main/java/io/opentelemetry/conformance/database/mongodb/reactive/MongoReactiveScenario.java |
Implements reactive workloads. |
scenarios/database/java/shared/mongodb/reactive/scenarios/build.gradle.kts |
Configures the reactive workload. |
scenarios/database/java/shared/mongodb/reactive/opentelemetry-library/src/main/java/MongoReactiveLibraryScenario.java |
Launches reactive library instrumentation. |
scenarios/database/java/shared/mongodb/reactive/opentelemetry-library/build.gradle.kts |
Adds reactive library dependencies. |
scenarios/database/java/shared/mongodb/reactive/opentelemetry-javaagent/src/main/java/MongoReactiveJavaagentScenario.java |
Launches reactive agent instrumentation. |
scenarios/database/java/shared/mongodb/reactive/opentelemetry-javaagent/build.gradle.kts |
Configures the reactive agent. |
scenarios/database/java/shared/mongodb/async/scenarios/src/main/java/io/opentelemetry/conformance/database/mongodb/async/MongoAsyncScenario.java |
Implements legacy async workloads. |
scenarios/database/java/shared/mongodb/async/scenarios/build.gradle.kts |
Configures the async workload. |
scenarios/database/java/shared/mongodb/async/opentelemetry-library/src/main/java/MongoAsyncLibraryScenario.java |
Launches async library instrumentation. |
scenarios/database/java/shared/mongodb/async/opentelemetry-library/build.gradle.kts |
Adds async library dependencies. |
scenarios/database/java/shared/mongodb/async/opentelemetry-javaagent/src/main/java/MongoAsyncJavaagentScenario.java |
Launches async agent instrumentation. |
scenarios/database/java/shared/mongodb/async/opentelemetry-javaagent/build.gradle.kts |
Configures the async agent. |
scenarios/database/java/settings.gradle.kts |
Registers MongoDB Gradle projects. |
scenarios/database/java/README.md |
Documents Java MongoDB coverage. |
scenarios/database/java/mongodb/sync/opentelemetry-library/database.yaml |
Selects the MongoDB backend. |
scenarios/database/java/mongodb/sync/opentelemetry-library/data.json |
Records sync library coverage. |
scenarios/database/java/mongodb/sync/opentelemetry-library/conformance.yaml |
Defines sync library expectations. |
scenarios/database/java/mongodb/sync/opentelemetry-javaagent/database.yaml |
Selects the MongoDB backend. |
scenarios/database/java/mongodb/sync/opentelemetry-javaagent/data.json |
Records sync agent coverage. |
scenarios/database/java/mongodb/sync/opentelemetry-javaagent/conformance.yaml |
Defines sync agent expectations. |
scenarios/database/java/mongodb/reactive/opentelemetry-library/database.yaml |
Selects the MongoDB backend. |
scenarios/database/java/mongodb/reactive/opentelemetry-library/data.json |
Records reactive library coverage. |
scenarios/database/java/mongodb/reactive/opentelemetry-library/conformance.yaml |
Defines reactive library expectations. |
scenarios/database/java/mongodb/reactive/opentelemetry-javaagent/database.yaml |
Selects the MongoDB backend. |
scenarios/database/java/mongodb/reactive/opentelemetry-javaagent/data.json |
Records reactive agent coverage. |
scenarios/database/java/mongodb/reactive/opentelemetry-javaagent/conformance.yaml |
Defines reactive agent expectations. |
scenarios/database/java/mongodb/async/opentelemetry-library/database.yaml |
Selects the MongoDB backend. |
scenarios/database/java/mongodb/async/opentelemetry-library/data.json |
Records async library coverage. |
scenarios/database/java/mongodb/async/opentelemetry-library/conformance.yaml |
Defines async library expectations. |
scenarios/database/java/mongodb/async/opentelemetry-javaagent/database.yaml |
Selects the MongoDB backend. |
scenarios/database/java/mongodb/async/opentelemetry-javaagent/data.json |
Records async agent coverage. |
scenarios/database/java/mongodb/async/opentelemetry-javaagent/conformance.yaml |
Defines async agent expectations. |
scenarios/database/java/gradle/libs.versions.toml |
Adds MongoDB dependencies and versions. |
.github/renovate.json5 |
Enables MongoDB image updates. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
trask
force-pushed
the
trask-add-mongodb-database-domain
branch
from
August 30, 2026 22:47
5b76b11 to
f24eeb4
Compare
Review finding:
The new MongoDB parameter row brings a seeding bootstrap under the shared assertion `assert b"INSERT INTO" not in schema` on line 166, which exists to prove that a packaged schema seeds no data. The MongoDB bootstrap does seed data: mongodb.js calls insertMany with four documents, and this same PR documents that in tools/database/runner/README.md ("recreates the `items` collection with deterministic documents") and in scenarios/database/README.md. For the MongoDB parameter the assertion can never fail and checks nothing, so the test now asserts a property the MongoDB bootstrap does not have. Fix: make the seeding claim per-backend, for example by removing the INSERT INTO assertion from this lifecycle test and asserting that postgres.sql and mariadb.sql contain no INSERT INTO inside test_the_schema_is_packaged_with_the_runner, which already reads each packaged file.
Analysis: "seeds no rows" is a property of an individual packaged schema, not of the shared container lifecycle, so it belongs with the per-file assertions in test_the_schema_is_packaged_with_the_runner rather than in the parametrized lifecycle test. Keeping it in the lifecycle test forced one claim onto every backend, and the MongoDB bootstrap seeds four documents on purpose, so the claim silently became a substring check that no JavaScript bootstrap can ever trip. Moving it to postgres.sql and mariadb.sql states it exactly where it holds, next to the assertions that already describe what each relational schema creates. The lifecycle test keeps schema_marker, which is what proves the right file reached the container.
Upsides: every assertion now checks the file it is written about; the relational no-rows contract is stated once per schema instead of once for all backends; a future backend that seeds data no longer inherits a claim that contradicts it.
Downsides: the no-rows check now lives in a different test from the transfer it constrains, so a reader of the lifecycle test has to look at test_the_schema_is_packaged_with_the_runner to see what each schema may contain.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Review finding:
This line replaced the sentence "`runner_config` must contain only `backend`, set to `postgresql` or `mariadb`." The replacement keeps the list of supported backends but drops the "must contain only `backend`" constraint. The code still enforces that constraint: _backend_name in tools/database/runner/src/database_conformance/__init__.py raises a SpecError saying runner_config "must contain exactly one string key named 'backend'" for an extra or differently named key, and test_database_session_rejects_invalid_backend_configuration still covers it. No other sentence in this README states the constraint, so after this PR a reader cannot learn from the docs that runner_config rejects any key besides backend. Fix: restore the constraint in the new sentence, for example "runner_config must contain only `backend`, whose supported values are `postgresql`, `mariadb`, and `mongodb`."
Analysis: `_backend_name` rejects a `runner_config` whose key set is anything other than `{"backend"}`, so a package that adds a second key fails to load rather than having the key ignored. That is the kind of rule a reader needs before writing the block, and the README's example shows only the valid shape, which on its own does not say whether more keys are allowed. Folding the constraint back into the same sentence that lists the backends keeps the paragraph at one idea per sentence and adds no new section.
Upsides: the documented contract matches what the loader enforces and what test_database_session_rejects_invalid_backend_configuration covers; a package author learns the rule before hitting the SpecError.
Downsides: the sentence carries two facts, the exact-key rule and the list of backends, so a future backend edits a slightly longer line.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pull request dashboard statusWaiting on the author · refreshed 2026-09-17 06:53 UTC Move out of draft to request review. Status above doesn't look right?
|
This branch has not been deployed
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.
Adds Java MongoDB conformance for the current synchronous and Reactive Streams drivers and the final legacy async driver release, each through the Java agent and published
opentelemetry-mongo-3.1library.find,update,delete, andaggregateworkloads against a digest-pinned MongoDB 8.0 container.endSessionslifecycle command.db.mongodb.clientclassification, generated coverage snapshots, docs, and Renovate tracking.The legacy async API is intentionally pinned to 3.12.14 because that line is unmaintained and was replaced by Reactive Streams. MongoDB instrumentation currently does not emit
db.query.summary; expectations assert that gap explicitly.