Skip to content
Draft
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
97d8a5b
added first tracing tests
nhachicha Jul 11, 2025
c82a6a2
using unsetOrMatches for txNumber, since it's not set for single topo…
nhachicha Jul 16, 2025
61270d6
updating tests
nhachicha Jul 20, 2025
581faa1
Tests and schema update for the upcoming Otel spec
nhachicha Aug 8, 2025
c447d10
Merge branch 'nh/tracing'
nhachicha Aug 8, 2025
3a578ee
Update generated files
nhachicha Aug 8, 2025
dbb1a9c
update schema to latest (1.26)
nhachicha Aug 8, 2025
29e25a1
update tests
nhachicha Aug 8, 2025
f801d78
DRIVERS-719 OpenTelementry specification
comandeo-mongo Jun 26, 2025
9d66a8a
Cursor operations
comandeo-mongo Aug 1, 2025
269221c
update doc
nhachicha Aug 9, 2025
452696d
moved tests under open-telemtry directroy
nhachicha Aug 9, 2025
9f05c59
Fixing formatting
nhachicha Aug 9, 2025
0523751
update formatting using pre-commit mdformat
nhachicha Aug 9, 2025
8466c1b
Adding Test README
nhachicha Aug 9, 2025
18ad723
Adding retries test, fixing duplicate exception tag
nhachicha Aug 13, 2025
04b947a
Update source/open-telemetry/open-telemetry.md
nhachicha Aug 14, 2025
88c7be0
Update source/open-telemetry/open-telemetry.md
nhachicha Aug 14, 2025
ced82eb
Update source/unified-test-format/tests/invalid/entity-client-observe…
nhachicha Aug 15, 2025
f1804c3
Update source/unified-test-format/tests/invalid/expectedTracingSpans-…
nhachicha Aug 15, 2025
03d4e3c
Update source/unified-test-format/tests/invalid/entity-client-observe…
nhachicha Aug 15, 2025
3c69ed5
Update source/unified-test-format/tests/invalid/expectedTracingSpans-…
nhachicha Aug 15, 2025
240d009
Update source/unified-test-format/tests/invalid/expectedTracingSpans-…
nhachicha Aug 15, 2025
6a4d217
Update source/unified-test-format/tests/invalid/expectedTracingSpans-…
nhachicha Aug 15, 2025
b596f05
Update generated files
nhachicha Aug 15, 2025
bbb075b
Update source/unified-test-format/tests/invalid/expectedTracingSpans-…
nhachicha Aug 15, 2025
a5638da
Update source/unified-test-format/tests/invalid/expectedTracingSpans-…
nhachicha Aug 15, 2025
56570a5
Update source/unified-test-format/tests/invalid/expectedTracingSpans-…
nhachicha Aug 15, 2025
a4aa513
Update source/unified-test-format/tests/invalid/expectedTracingSpans-…
nhachicha Aug 15, 2025
cb74b54
Using YAML anchors and references
nhachicha Aug 14, 2025
3caa87f
PR feedback: Updating schema, adding more invalid tests
nhachicha Aug 15, 2025
7a68cbc
Fixing lint errors
nhachicha Aug 15, 2025
1c24759
Update source/open-telemetry/open-telemetry.md
comandeo-mongo Aug 18, 2025
a989a49
Update source/open-telemetry/open-telemetry.md
comandeo-mongo Aug 18, 2025
c84847c
adding more tests for operations
nhachicha Aug 20, 2025
a808992
update list of supported operations
nhachicha Aug 20, 2025
f78b541
Adjust spec format
comandeo-mongo Sep 2, 2025
67d4c90
Clarify cursor operation and transactions nesting
comandeo-mongo Sep 3, 2025
b478c9e
Fix bulkWrite test
comandeo-mongo Sep 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions source/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
- [MongoDB Handshake](mongodb-handshake/handshake.md)
- [OCSP Support](ocsp-support/ocsp-support.md)
- [OP_MSG](message/OP_MSG.md)
- [OpenTelemetry](open-telemetry/open-telemetry.md)
- [Performance Benchmarking](benchmarking/benchmarking.md)
- [Polling SRV Records for mongos Discovery](polling-srv-records-for-mongos-discovery/polling-srv-records-for-mongos-discovery.md)
- [Read and Write Concern](read-write-concern/read-write-concern.md)
Expand Down
282 changes: 282 additions & 0 deletions source/open-telemetry/open-telemetry.md

Large diffs are not rendered by default.

34 changes: 34 additions & 0 deletions source/open-telemetry/tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# OpenTelemetry Tests

______________________________________________________________________

## Testing

### Automated Tests

The YAML and JSON files in this directory are platform-independent tests meant to exercise a driver's implementation of
the OpenTelemetry specification. These tests utilize the
[Unified Test Format](../../unified-test-format/unified-test-format.md).

For each test, create a MongoClient, configure it to enable tracing.

```yaml
createEntities:
- client:
id: client0
observeTracingMessages:
enableCommandPayload: true
```
These tests require the ability to collect tracing [spans](../open-telemetry.md#span) data in a structured form as
described in the
[Unified Test Format specification.expectTracingMessages](../../unified-test-format/unified-test-format.md#expectTracingMessages).
For example the Java driver uses [Micrometer](https://jira.mongodb.org/browse/JAVA-5732) to collect tracing spans.
```yaml
expectTracingMessages:
client: client0
ignoreExtraSpans: false
spans:
...
```
300 changes: 300 additions & 0 deletions source/open-telemetry/tests/cursor/cursor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,300 @@
{
"description": "cursor retrieval",
"schemaVersion": "1.26",
"createEntities": [
{
"client": {
"id": "client0",
"useMultipleMongoses": false,
"observeTracingMessages": {
"enableCommandPayload": true
}
}
},
{
"database": {
"id": "database0",
"client": "client0",
"databaseName": "cursor"
}
},
{
"collection": {
"id": "collection0",
"database": "database0",
"collectionName": "test"
}
}
],
"initialData": [
{
"collectionName": "test",
"databaseName": "cursor",
"documents": [
{
"_id": 1
},
{
"_id": 2
},
{
"_id": 3
},
{
"_id": 4
},
{
"_id": 5
},
{
"_id": 6
}
]
}
],
"tests": [
{
"description": "find with a cursor",
"operations": [
{
"name": "find",
"object": "collection0",
"arguments": {
"filter": {
"_id": {
"$gt": 1
}
},
"batchSize": 2
},
"expectResult": [
{
"_id": 2
},
{
"_id": 3
},
{
"_id": 4
},
{
"_id": 5
},
{
"_id": 6
}
]
}
],
"expectTracingMessages": {
"client": "client0",
"ignoreExtraSpans": false,
"spans": [
{
"name": "find cursor.test",
"tags": {
"db.system": "mongodb",
"db.namespace": "cursor",
"db.collection.name": "test",
"db.operation.name": "find",
"db.operation.summary": "find cursor.test"
},
"nested": [
{
"name": "command find",
"tags": {
"db.system": "mongodb",
"db.namespace": "cursor",
"db.collection.name": "cursor.$cmd",
"db.command.name": "find",
"network.transport": "tcp",
"db.mongodb.cursor_id": {
"$$exists": false
},
"db.response.status_code": {
"$$exists": false
},
"exception.message": {
"$$exists": false
},
"exception.type": {
"$$exists": false
},
"exception.stacktrace": {
"$$exists": false
},
"server.address": {
"$$type": "string"
},
"server.port": {
"$$type": [
"int",
"long"
]
},
"server.type": {
"$$type": "string"
},
"db.query.summary": "find",
"db.query.text": {
"$$matchAsDocument": {
"$$matchAsRoot": {
"find": "test",
"filter": {
"_id": {
"$gt": 1
}
},
"batchSize": 2
}
}
},
"db.mongodb.server_connection_id": {
"$$type": [
"int",
"long"
]
},
"db.mongodb.driver_connection_id": {
"$$type": [
"int",
"long"
]
}
}
},
{
"name": "command getMore",
"tags": {
"db.system": "mongodb",
"db.namespace": "cursor",
"db.collection.name": "cursor.$cmd",
"db.command.name": "getMore",
"network.transport": "tcp",
"db.mongodb.cursor_id": {
"$$type": [
"int",
"long"
]
},
"db.response.status_code": {
"$$exists": false
},
"exception.message": {
"$$exists": false
},
"exception.type": {
"$$exists": false
},
"exception.stacktrace": {
"$$exists": false
},
"server.address": {
"$$type": "string"
},
"server.port": {
"$$type": [
"int",
"long"
]
},
"server.type": {
"$$type": "string"
},
"db.query.summary": "getMore",
"db.query.text": {
"$$matchAsDocument": {
"$$matchAsRoot": {
"getMore": {
"$$type": "long"
},
"collection": "test",
"batchSize": 2
}
}
},
"db.mongodb.server_connection_id": {
"$$type": [
"int",
"long"
]
},
"db.mongodb.driver_connection_id": {
"$$type": [
"int",
"long"
]
}
}
},
{
"name": "command getMore",
"tags": {
"db.system": "mongodb",
"db.namespace": "cursor",
"db.collection.name": "cursor.$cmd",
"db.command.name": "getMore",
"network.transport": "tcp",
"db.mongodb.cursor_id": {
"$$type": [
"int",
"long"
]
},
"db.response.status_code": {
"$$exists": false
},
"exception.message": {
"$$exists": false
},
"exception.type": {
"$$exists": false
},
"exception.stacktrace": {
"$$exists": false
},
"server.address": {
"$$type": "string"
},
"server.port": {
"$$type": [
"int",
"long"
]
},
"server.type": {
"$$type": "string"
},
"db.query.summary": "getMore",
"db.query.text": {
"$$matchAsDocument": {
"$$matchAsRoot": {
"getMore": {
"$$type": "long"
},
"collection": "test",
"batchSize": 2
}
}
},
"db.mongodb.server_connection_id": {
"$$type": [
"int",
"long"
]
},
"db.mongodb.driver_connection_id": {
"$$type": [
"int",
"long"
]
}
}
}
]
}
]
}
}
]
}
Loading
Loading