From 73d316f5ca5e9699b318eaa934c673600bc8d42c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 22 May 2026 15:27:30 +0000 Subject: [PATCH 1/3] Initial plan From b7e0ca2360accf75e7465d44d144c7ad9a4099d4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 22 May 2026 15:33:10 +0000 Subject: [PATCH 2/3] tests: stabilize pymongo span compression assertion Agent-Logs-Url: https://github.com/elastic/apm-agent-python/sessions/b043e436-c1b0-4e37-a4a3-30789ebc0112 Co-authored-by: xrmx <12932+xrmx@users.noreply.github.com> --- tests/instrumentation/pymongo_tests.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/instrumentation/pymongo_tests.py b/tests/instrumentation/pymongo_tests.py index d93b3401d..296fe23e1 100644 --- a/tests/instrumentation/pymongo_tests.py +++ b/tests/instrumentation/pymongo_tests.py @@ -393,7 +393,11 @@ def test_mongodb_span_compression(instrument, elasticapm_client, mongo_database) elasticapm_client.end_transaction("transaction.test") transactions = elasticapm_client.events[TRANSACTION] spans = elasticapm_client.spans_for_transaction(transactions[0]) - assert len(spans) == 1 + composite_spans = [span for span in spans if "composite" in span] + assert len(composite_spans) == 1 + assert composite_spans[0]["composite"]["compression_strategy"] == "exact_match" + assert composite_spans[0]["composite"]["count"] >= 2 + assert sum(span.get("composite", {}).get("count", 1) for span in spans) == 5 def _get_pymongo_span(spans): From ce4f13a5bb0d80929972c24d6ef3c22a09ebf127 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 22 May 2026 15:33:55 +0000 Subject: [PATCH 3/3] tests: relax pymongo span compression count assumption Agent-Logs-Url: https://github.com/elastic/apm-agent-python/sessions/b043e436-c1b0-4e37-a4a3-30789ebc0112 Co-authored-by: xrmx <12932+xrmx@users.noreply.github.com> --- tests/instrumentation/pymongo_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/instrumentation/pymongo_tests.py b/tests/instrumentation/pymongo_tests.py index 296fe23e1..c72d2d039 100644 --- a/tests/instrumentation/pymongo_tests.py +++ b/tests/instrumentation/pymongo_tests.py @@ -396,7 +396,7 @@ def test_mongodb_span_compression(instrument, elasticapm_client, mongo_database) composite_spans = [span for span in spans if "composite" in span] assert len(composite_spans) == 1 assert composite_spans[0]["composite"]["compression_strategy"] == "exact_match" - assert composite_spans[0]["composite"]["count"] >= 2 + assert composite_spans[0]["composite"]["count"] > 1 assert sum(span.get("composite", {}).get("count", 1) for span in spans) == 5