Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
fb8b1ca
DRIVERS-3454: design for OTel trace-context propagation over OP_MSG
nhachicha Jun 1, 2026
eaf9412
DRIVERS-3454: implementation plan for OP_MSG trace-context POC (drive…
nhachicha Jun 2, 2026
2872afc
POC WIP
nhachicha Jun 4, 2026
6bac9e1
DRIVERS-3454: design for reference implementation (BSON telemetry sec…
nhachicha Jul 13, 2026
6f0913e
DRIVERS-3454: implementation plan for reference implementation
nhachicha Jul 13, 2026
1817abc
DRIVERS-3454: add NINE_DOT_ZERO_WIRE_VERSION (29) constant
nhachicha Jul 13, 2026
3fae199
DRIVERS-3454: guarantee traceParent() is server-valid; propagate unsa…
nhachicha Jul 14, 2026
3522a3a
DRIVERS-3454: write BSON telemetry section gated on maxWireVersion >= 29
nhachicha Jul 14, 2026
134ccc1
DRIVERS-3454: remove hello-capability plumbing and test toggle (wire-…
nhachicha Jul 14, 2026
64df7cf
DRIVERS-3454: prose-test definitions for trace-context propagation
nhachicha Jul 14, 2026
b6594f8
DRIVERS-3454: e2e server-span linkage prose test (OTLP file exporter)
nhachicha Jul 14, 2026
3a16a4e
DRIVERS-3454: mark POC design superseded
nhachicha Jul 14, 2026
e9e1551
DRIVERS-3454: update e2e runbook for 9.0 server and OTLP file exporter
nhachicha Jul 14, 2026
c3547b1
DRIVERS-3454: guard traceparent production against absent optional mi…
nhachicha Jul 14, 2026
0db80ce
DRIVERS-3454: drop dead null-check on Span.context() (non-null by @Nu…
nhachicha Jul 18, 2026
f3c6d08
DRIVERS-3454: IDE polish (suppress always-inverted hint, EMPTY as lam…
nhachicha Jul 18, 2026
983f281
DRIVERS-3454: design for minimal spec change (OP_MSG + OTel specs)
nhachicha Jul 18, 2026
c9e24d9
DRIVERS-3454: plan for minimal spec change
nhachicha Jul 18, 2026
de30af2
DRIVERS-3454: design for command-span trace propagation (Option A)
nhachicha Jul 20, 2026
11967c0
DRIVERS-3454: plan for command-span trace propagation
nhachicha Jul 20, 2026
008efad
DRIVERS-3454: createTracingSpan reads the raw command document (no en…
nhachicha Jul 21, 2026
3875183
DRIVERS-3454: encode overload carries the command span for the teleme…
nhachicha Jul 21, 2026
4da5d2f
DRIVERS-3454: create command span before encode; propagate its context
nhachicha Jul 21, 2026
4a9886a
DRIVERS-3454: e2e + prose docs assert command-span parentage
nhachicha Jul 21, 2026
9ef02da
DRIVERS-3454: note command-span amendment in reference-impl design
nhachicha Jul 21, 2026
04b4da7
DRIVERS-3454: fix stale mechanism comment in e2e test
nhachicha Jul 21, 2026
12d3742
DRIVERS-3454: correct traceparent-mechanism wording in prose doc and …
nhachicha Jul 21, 2026
b95ede4
DRIVERS-3454: document pre-existing sync-path span-leak window (futur…
nhachicha Jul 21, 2026
6a24bfb
DRIVERS-3454: record prose-test decision (deferred; interop test chos…
nhachicha Jul 21, 2026
ccf0a7c
DRIVERS-3454: clarify getRawCommandDocument javadoc
nhachicha Jul 22, 2026
99c3282
DRIVERS-3454: narrow raw-command access to getCommandName/getGetMoreC…
nhachicha Jul 22, 2026
61718db
DRIVERS-3454: refine span-leak follow-up (unconditional closeScope, e…
nhachicha Jul 22, 2026
7e71e86
DRIVERS-3454: follow-up doc — settle exception unification on catch(T…
nhachicha Jul 22, 2026
46d71fd
JAVA-XXXX DRIVERS-3454: fix sync-path span-leak window with single-ow…
nhachicha Jul 22, 2026
ff018eb
DRIVERS-3454: mark span-leak follow-up implemented
nhachicha Jul 22, 2026
b57f134
DRIVERS-3454: extract expected telemetry document constant in test
nhachicha Jul 22, 2026
139c71a
DRIVERS-3454: assert reconstructed command has no otel key
nhachicha Jul 22, 2026
b99c15c
DRIVERS-3454: cover DualMessageSequences (clientBulkWrite path) in te…
nhachicha Jul 22, 2026
34eb455
DRIVERS-3454: parametrize telemetry-section omission cases
nhachicha Jul 22, 2026
314b07c
DRIVERS-3454: untrack ServerSpanLinkageProseTest (kept as local-only …
nhachicha Jul 23, 2026
4aaa158
Cleanup
nhachicha Jul 23, 2026
6d02614
DRIVERS-3454: untrack docs/superpowers (kept locally; already gitigno…
nhachicha Jul 23, 2026
4ad8737
DRIVERS-3454: revert pairing-guard test in LoggingCommandEventSenderS…
nhachicha Jul 23, 2026
c5df8d9
DRIVERS-3454: drop explanatory comment from sendAndReceiveInternal
nhachicha Jul 23, 2026
55942c4
DRIVERS-3454: revert LoggingCommandEventSender pairing guard (kept lo…
nhachicha Jul 23, 2026
5578926
update doc
nhachicha Jul 23, 2026
a4e9950
Bump to wire protocol 29 and Copilot feedback
nhachicha Jul 23, 2026
b332e69
review feedback
nhachicha Jul 23, 2026
2b1b6b1
JAVA-6222: server-span prose tests (linkage, per-retry-attempt, no au…
nhachicha Sep 9, 2026
48d1c54
JAVA-6222: Evergreen wiring for OTel tracing prose test
nhachicha Sep 9, 2026
0033e9d
JAVA-6222: align server-span prose tests with spec prose Tests 5-7
nhachicha Sep 14, 2026
5784d68
JAVA-6222: drop temporary drivers-evergreen-tools fork checkout (DRIV…
nhachicha Sep 14, 2026
635a1b2
JAVA-6222: run OTel tracing prose test on macOS arm64 as well
nhachicha Sep 15, 2026
cb9c218
JAVA-6222: register /opt/java JDKs with Gradle toolchain detection fo…
nhachicha Sep 15, 2026
292deeb
JAVA-6222: resolve real JDK homes for Gradle toolchain paths on macOS
nhachicha Sep 15, 2026
e5837cd
JAVA-6222: neutralize empty Contents/Home bundle skeleton in macOS JD…
nhachicha Sep 15, 2026
0e14771
JAVA-6222: limit OTel tracing variant to linux (macOS server binaries…
nhachicha Sep 15, 2026
71630ae
JAVA-6222: address review feedback
nhachicha Sep 29, 2026
f787b54
JAVA-6222: bump micrometer-tracing to 1.7.1 and micrometer BOM to 1.17.1
nhachicha Sep 29, 2026
54207c4
JAVA-6222: work around DRIVERS-3663 for latest-version tasks
nhachicha Sep 29, 2026
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
65 changes: 64 additions & 1 deletion .evergreen/.evg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,14 @@ functions:
else
git clone --depth 1 https://github.com/mongodb-labs/drivers-evergreen-tools.git $DRIVERS_TOOLS
fi
# TODO(DRIVERS-3663): remove once fixed upstream. mongodl's GPG verification of "latest"
# downloads creates its keyring under $TMPDIR; with our TMPDIR=$MONGO_ORCHESTRATION_HOME/db
# the gpg-agent socket path exceeds the AF_UNIX 108-char limit and orchestration fails.
# Create the keyring under /tmp instead (same as the proposed upstream fix).
if [ "${VERSION}" = "latest" ]; then
perl -i -pe 's/TemporaryDirectory\(prefix="mongodl-gpg"\)/TemporaryDirectory(prefix="mongodl-gpg", dir="\/tmp")/' \
$DRIVERS_TOOLS/.evergreen/server_artifacts.py
fi
echo "{ \"releases\": { \"default\": \"$MONGODB_BINARIES\" }}" > $MONGO_ORCHESTRATION_HOME/orchestration.config

"fix-absolute-paths":
Expand Down Expand Up @@ -152,13 +160,47 @@ functions:
params:
script: |
${PREPARE_SHELL}
REQUIRE_API_VERSION=${REQUIRE_API_VERSION} LOAD_BALANCER=${LOAD_BALANCER} MONGODB_VERSION=${VERSION} TOPOLOGY=${TOPOLOGY} \
REQUIRE_API_VERSION=${REQUIRE_API_VERSION} LOAD_BALANCER=${LOAD_BALANCER} OTEL=${OTEL} MONGODB_VERSION=${VERSION} TOPOLOGY=${TOPOLOGY} \
AUTH=${AUTH} SSL=${SSL} STORAGE_ENGINE=${STORAGE_ENGINE} ORCHESTRATION_FILE=${ORCHESTRATION_FILE} \
bash ${DRIVERS_TOOLS}/.evergreen/run-orchestration.sh
# run-orchestration generates expansion file with the MONGODB_URI for the cluster
- command: expansions.update
params:
file: mo-expansion.yml
"run-otel-tracing-tests":
- command: shell.exec
type: "test"
params:
working_dir: "src"
script: |
${PREPARE_SHELL}
MONGODB_URI="${MONGODB_URI}" OTEL_TRACE_DIR="${OTEL_TRACE_DIR}" JAVA_VERSION="${JAVA_VERSION}" \
.evergreen/run-otel-tracing-tests.sh

# Uploads the server's exported OTel trace files (DRIVERS-3605) when present. Must run after
# "upload-mo-artifacts" in the post block, which assumes the upload role this relies on.
"upload-otel-artifacts":
- command: shell.exec
params:
shell: "bash"
script: |
${PREPARE_SHELL}
if [ -d "$DRIVERS_TOOLS/otel" ]; then
tar czf otel-traces.tar.gz -C $DRIVERS_TOOLS otel
fi
- command: s3.put
params:
optional: true
aws_key: ${AWS_ACCESS_KEY_ID}
aws_secret: ${AWS_SECRET_ACCESS_KEY}
aws_session_token: ${AWS_SESSION_TOKEN}
local_file: otel-traces.tar.gz
remote_file: ${UPLOAD_BUCKET}/${build_variant}/${revision}/${version_id}/${build_id}/otel/${task_id}-${execution}-otel-traces.tar.gz
bucket: mciuploads
permissions: public-read
content_type: "${content_type|application/x-gzip}"
display_name: "otel-traces.tar.gz"

"stop-mongo-orchestration":
- command: shell.exec
params:
Expand Down Expand Up @@ -838,6 +880,7 @@ pre:
post:
- func: "stop-mongo-orchestration"
- func: "upload-mo-artifacts"
- func: "upload-otel-artifacts"
- func: "upload-test-results"
- func: "assume-aws-test-secrets-role"
- func: "stop-load-balancer"
Expand Down Expand Up @@ -914,6 +957,13 @@ tasks:
TOPOLOGY: "server"
- func: "run-reactive-streams-tck-tests"

- name: "otel-tracing-prose-test-task"
commands:
- func: "start-mongo-orchestration"
vars:
OTEL: "true"
- func: "run-otel-tracing-tests"

- name: "load-balancer-test-task"
commands:
- func: "start-mongo-orchestration"
Expand Down Expand Up @@ -1784,6 +1834,9 @@ axes:
- id: "linux"
display_name: "Linux"
run_on: "rhel80-small"
- id: "macos-arm64"
display_name: "macOS arm64"
run_on: "macos-14-arm64"
# No single Ubuntu release has server builds for every version we test: 4.4 and 5.0 stop at
# ubuntu2004, while 9.0 starts at ubuntu2204. mongodl infers the download target from the host
# distro and does not fall back to an older target, so the host must match the server release.
Expand Down Expand Up @@ -2549,6 +2602,16 @@ buildvariants:
- name: "aws-auth-test-with-aws-credentials-and-session-token-as-environment-variables-task"
- name: "aws-auth-test-with-web-identity-credentials-task"

- matrix_name: "otel-tracing"
# auth: exercises prose Test 7 (no server spans for auth/monitoring commands) as written.
# linux only: macOS server binaries are not compiled with OpenTelemetry support (requires_otel_build),
# so no span files are ever exported there — re-add "macos-arm64" if that changes.
matrix_spec: { auth: "auth", ssl: "nossl", jdk: "jdk21", version: [ "latest" ], topology: "standalone", os: "linux" }
display_name: "OTel Tracing ${version} ${topology} ${os}"
tags: [ "tests-variant" ]
tasks:
- name: "otel-tracing-prose-test-task"

- matrix_name: "accept-api-version-2-test"
matrix_spec: { ssl: "nossl", auth: "noauth", jdk: "jdk21", version: [ "5.0", "6.0", "7.0", "8.0", "9.0", "latest" ], topology: "standalone",
os: "linux" }
Expand Down
53 changes: 53 additions & 0 deletions .evergreen/run-otel-tracing-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash

set -o errexit

# Runs the OTel trace-context propagation prose tests (DRIVERS-3454) against a deployment
# provisioned by drivers-evergreen-tools orchestration with OTEL=1 (DRIVERS-3605).
#
# Supported/used environment variables:
# MONGODB_URI Connection string for the OTel-enabled deployment (from mo-expansion)
# OTEL_TRACE_DIR Directory the server exports OTLP JSON span batches into (from mo-expansion)
# JAVA_VERSION JDK to run the tests with

RELATIVE_DIR_PATH="$(dirname "${BASH_SOURCE[0]:-$0}")"
source "${RELATIVE_DIR_PATH}/setup-env.bash"

if [ -z "$OTEL_TRACE_DIR" ]; then
echo "OTEL_TRACE_DIR is not set: orchestration was not started with OTEL=1" >&2
exit 1
fi

echo "Running OTel trace-context propagation prose tests"

./gradlew -version

# Toolchain auto-detection does not scan /opt/java, so point Gradle at the JDKs explicitly. On the macOS
# images the JDK content lives at the root of /opt/java/jdkNN, but a leftover macOS bundle skeleton with an
# EMPTY Contents/Home sits beside it; Gradle prefers Contents/Home whenever it exists and then rejects the
# installation ("does not contain a java executable") without falling back to the root. Neutralize that by
# removing the empty Contents/Home, or failing that, by symlinking the JDK into a clean bundle-free dir.
sanitize_jdk() {
local jdk_dir=$1
if [ -x "$jdk_dir/bin/java" ] && [ -d "$jdk_dir/Contents/Home" ] && [ ! -x "$jdk_dir/Contents/Home/bin/java" ]; then
if ! rmdir "$jdk_dir/Contents/Home" 2>/dev/null; then
local clean="$HOME/gradle-jdks/$(basename "$jdk_dir")"
mkdir -p "$clean"
local entry
for entry in bin conf include jmods legal lib release; do
[ -e "$jdk_dir/$entry" ] && ln -sfn "$jdk_dir/$entry" "$clean/$entry"
done
jdk_dir=$clean
fi
fi
echo "$jdk_dir"
}
TOOLCHAIN_PATHS="$(sanitize_jdk "$JDK17"),$(sanitize_jdk "$JDK21")"
echo "Gradle toolchain paths: ${TOOLCHAIN_PATHS}"

./gradlew --stacktrace --info \
-Porg.gradle.java.installations.paths="${TOOLCHAIN_PATHS}" \
-PjavaVersion="${JAVA_VERSION:-21}" \
-Dorg.mongodb.test.uri="${MONGODB_URI}" \
-Dorg.mongodb.test.otel.trace.dir="${OTEL_TRACE_DIR}" \
driver-sync:test --tests ServerSpanLinkageProseTest
6 changes: 6 additions & 0 deletions driver-core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,15 @@ dependencies {

optionalImplementation(platform(libs.micrometer.observation.bom))
optionalImplementation(libs.micrometer.observation)
optionalImplementation(libs.micrometer.tracing)

testImplementation(project(path = ":bson", configuration = "testArtifacts"))
testImplementation(libs.reflections)

// Tracing testing
testImplementation(platform(libs.micrometer.tracing.integration.test.bom))
testImplementation(libs.micrometer.tracing.integration.test) { exclude(group = "org.junit.jupiter") }

testImplementation(libs.netty.tcnative.boringssl.static)
listOf("linux-x86_64", "linux-aarch_64", "osx-x86_64", "osx-aarch_64", "windows-x86_64").forEach { arch ->
testImplementation("${libs.netty.tcnative.boringssl.static.get()}::$arch")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public class ServerDescription {
* The maximum supported driver wire version
* @since 3.8
*/
public static final int MAX_DRIVER_WIRE_VERSION = 25;
public static final int MAX_DRIVER_WIRE_VERSION = 29;

private static final int DEFAULT_MAX_DOCUMENT_SIZE = 0x1000000; // 16MB

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ private static MessageSettings getDocumentMessageSettings(final MessageSettings
.build();
}

private static MessageSettings.Builder createMessageSettingsBuilder(final MessageSettings settings) {
static MessageSettings.Builder createMessageSettingsBuilder(final MessageSettings settings) {
return MessageSettings.builder()
.maxBatchCount(settings.getMaxBatchCount())
.maxMessageSize(settings.getMaxMessageSize())
Expand Down
Loading