Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 12 additions & 0 deletions .evergreen/generated_configs/variants.yml
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,18 @@ buildvariants:
- windows-2022-latest-small
batchtime: 1440

# Otel tests
- name: otel-rhel8
tasks:
- name: .test-non-standard .standalone-noauth-nossl
display_name: OTel RHEL8
run_on:
- rhel8.10-small
expansions:
TEST_NAME: otel
COVERAGE: "1"
tags: [pr]

# Perf tests
- name: performance-benchmarks
tasks:
Expand Down
15 changes: 15 additions & 0 deletions .evergreen/scripts/generate_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,21 @@ def create_doctests_variants():
]


def create_otel_variants():
host = DEFAULT_HOST
# Merge otel's coverage into the combined report; see setup_tests.py's COVERAGE handling.
expansions = dict(TEST_NAME="otel", COVERAGE="1")
return [
create_variant(
[".test-non-standard .standalone-noauth-nossl"],
get_variant_name("OTel", host),
host=host,
tags=["pr"],
expansions=expansions,
)
]


def create_atlas_connect_variants():
host = DEFAULT_HOST
return [
Expand Down
11 changes: 9 additions & 2 deletions .evergreen/scripts/setup_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"enterprise_auth": "gssapi",
"kms": "encryption",
"ocsp": "ocsp",
"otel": "opentelemetry",
"pyopenssl": "ocsp",
}

Expand Down Expand Up @@ -502,6 +503,11 @@ def handle_test_env() -> None:
if test_name == "numpy":
UV_ARGS.append("--with numpy")

if test_name == "otel":
# The SDK is test-only tooling (for the in-memory span exporter); the driver
# itself must not depend on it, only on opentelemetry-api (the "opentelemetry" extra).
UV_ARGS.append("--with opentelemetry-sdk")

if test_name == "perf":
data_dir = ROOT / "specifications/source/benchmarking/data"
if not data_dir.exists():
Expand All @@ -523,9 +529,10 @@ def handle_test_env() -> None:
else:
TEST_ARGS = f"test/performance/async_perf_test.py {TEST_ARGS}"

# Add coverage if requested.
# Add coverage if requested, either via --cov or a pre-set COVERAGE expansion
# (e.g. a buildvariant that wants its coverage merged into the combined report).
# Only cover CPython. PyPy reports suspiciously low coverage.
if opts.cov and platform.python_implementation() == "CPython":
if (opts.cov or is_set("COVERAGE")) and platform.python_implementation() == "CPython":
# Keep in sync with combine-coverage.sh.
# coverage >=5 is needed for relative_files=true.
UV_ARGS.append("--group coverage")
Expand Down
1 change: 1 addition & 0 deletions .evergreen/scripts/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class Distro:
"load_balancer": "load_balancer",
"mockupdb": "mockupdb",
"ocsp": "ocsp",
"otel": "otel",
"perf": "perf",
"sfp": "sfp",
"numpy": "",
Expand Down
6 changes: 6 additions & 0 deletions doc/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@ PyMongo 4.18 brings a number of changes including:
:meth:`~pymongo.synchronous.database.Database.aggregate`, and
:meth:`~pymongo.asynchronous.collection.AsyncCollection.list_search_indexes`
and :meth:`~pymongo.synchronous.collection.Collection.list_search_indexes`.
- Added optional OpenTelemetry command-span support, conforming to the
`OpenTelemetry driver specification <https://github.com/mongodb/specifications/blob/master/source/open-telemetry/open-telemetry.md>`_.
Enable it with the ``tracing`` :class:`~pymongo.mongo_client.MongoClient`
option or the ``OTEL_PYTHON_INSTRUMENTATION_MONGODB_ENABLED`` environment
variable. Install the ``opentelemetry-api`` package, or use the
``pymongo[opentelemetry]`` extra, to enable this feature.
Comment on lines +155 to +160

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge artifact?


Changes in Version 4.17.0 (2026/04/20)
--------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set shell := ["bash", "-c"]

# Commonly used command segments.
typing_run := "uv run --group typing --extra aws --extra encryption --with numpy --extra ocsp --extra snappy --extra test --extra zstd"
typing_run := "uv run --group typing --extra aws --extra encryption --with numpy --extra ocsp --extra opentelemetry --with opentelemetry-sdk --extra snappy --extra test --extra zstd"
docs_run := "uv run --extra docs"
doc_build := "./doc/_build"
mypy_args := "--install-types --non-interactive"
Expand Down
Loading
Loading