Repository navigation
Conversation
Implements the benchmarking requirements of the OpenTelemetry spec's "Performance Implications" section (mongodb/specifications#1986): - OtelBenchmarkSuite runs the DriverBench "Small doc insertOne" and "Find one by ID" tasks, sync and Reactive Streams, under one tracing configuration per JVM: off, api-only (ObservationRegistry with no handlers), sdk-ratio (OTel SDK, 1% TraceIdRatioBased sampler) and sdk-always (alwaysOn). The harness installs the SDK; no exporter or span processor is installed. A verify mode counts spans per operation. - InstrumentedBenchmarkRunner records wall time, process CPU time and GC time per iteration, reporting MB/s and CPU-per-op excluding GC. - otel-bench.py runs the configurations interleaved with rotated order across repetitions and writes a report; a pre-OTel baseline worktree can be included for the spec's one-time comparison. - otel-compare-langs.py and otel-compare-runs.py produce cross-language and before/after tables. New benchmark-only dependencies (micrometer-tracing-bridge-otel, opentelemetry-sdk-trace via opentelemetry-bom) are declared in the version catalog and used only by driver-benchmarks. Run: ./gradlew :driver-benchmarks:runOtel -Dorg.mongodb.benchmarks.data=... -Dorg.mongodb.benchmarks.output=... -Dorg.mongodb.benchmarks.otel.config=sdk-ratio
Owner
Author
|
Superseded: reopened against mongodb/mongo-java-driver main. |
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.
Benchmark harness for the OpenTelemetry spec's "Performance Implications" section (mongodb/specifications#1986, DRIVERS-3620). Draft on the fork; not intended for upstream in this form.
What it adds
OtelBenchmarkSuite(driver-benchmarks/.../otel/): runs DriverBench "Small doc insertOne" and "Find one by ID", sync and Reactive Streams, under one tracing configuration per JVM, selected by-Dorg.mongodb.benchmarks.otel.config:off: noObservabilitySettings(baseline)api-only:ObservationRegistry.create()with no handlers; Micrometer short-circuits to a no-op observation, so the driver runs its instrumentation code but nothing recordssdk-ratio: OTelSdkTracerProviderwithtraceIdRatioBased(0.01), bridged viaDefaultTracingObservationHandler, no exporter or processorsdk-always: same withalwaysOn()InstrumentedBenchmarkRunner: wall time, process CPU time and GC time per iteration; reports MB/s, wall/op, CPU/op, CPU-excluding-GC/op.-Dorg.mongodb.benchmarks.otel.verify=trueinstalls a counting span processor and reports spans per op (2.00 undersdk-always, 0.02 undersdk-ratio), for wiring checks only.otel-bench.py: one JVM per configuration, configurations interleaved and order rotated per repetition, writesREPORT.md/summary.json; accepts a pre-OTel worktree for the spec's one-time comparison.otel-compare-langs.py,otel-compare-runs.py: cross-language and before/after tables.New benchmark-only deps in the catalog:
opentelemetry-bom1.53.0,opentelemetry-sdk-trace,micrometer-tracing-bridge-otel. Used only bydriver-benchmarks; the driver itself is unchanged.Results (main
503c4caebc, Apple M4 Max, mongod 8.2.6, Temurin 17, 5 reps, medians)Loss vs
off/ added CPU µs per op (excl. GC):offvs pre-OTel commitPre-OTel commit is
e1bf5f57b1(parent of mongodb#1695). Python/Ruby comparison and full method are in the local archivenabil_otel_benchmark_drivers3620/.Usage
Open points before upstream
api-onlymapping for a Micrometer driver is a judgement call; see the spec PR discussion.