From 6edd3f5c9541521155f9715d5bf99288db2640a4 Mon Sep 17 00:00:00 2001 From: Victor Pellan Date: Fri, 2 Oct 2026 15:50:14 +0200 Subject: [PATCH 1/3] Expand OTLP metrics temporality preference coverage --- manifests/c.yml | 2 + manifests/cpp.yml | 3 +- manifests/dotnet.yml | 5 +- manifests/golang.yml | 8 + manifests/java.yml | 5 +- manifests/nodejs.yml | 5 +- manifests/php.yml | 4 +- manifests/python.yml | 5 +- manifests/ruby.yml | 9 +- manifests/rust.yml | 5 +- ...ter_otlp_metrics_temporality_preference.py | 397 +++++++++++------- utils/_features.py | 8 + 12 files changed, 295 insertions(+), 161 deletions(-) diff --git a/manifests/c.yml b/manifests/c.yml index 74790bac4fc..6a83ea26a26 100644 --- a/manifests/c.yml +++ b/manifests/c.yml @@ -5,6 +5,8 @@ manifest: tests/appsec/: irrelevant (dd-trace-c does not implement AppSec or IAST) tests/cws/test_thread_context_sharing.py::Test_ThreadContextSharing: missing_feature (missing /security/thread_context_sharing endpoint on weblog) tests/integrations/test_dbm.py: incomplete_test_app (The Perl Mojolicious workload does not provide database endpoints) + ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py::Test_OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + : missing_feature tests/parametric/otel_env_vars/test_otel_logs_exporter.py::Test_OTEL_LOGS_EXPORTER: missing_feature tests/serverless/: irrelevant (dd-trace-c does not instrument serverless runtimes) tests/test_config_consistency.py::Test_Config_ClientTagQueryString_Empty: missing_feature (dd-trace-c does not support configuring query-string tagging) diff --git a/manifests/cpp.yml b/manifests/cpp.yml index 0b7402f15e1..61c89ad58df 100644 --- a/manifests/cpp.yml +++ b/manifests/cpp.yml @@ -64,7 +64,8 @@ manifest: tests/parametric/otel_env_vars/test_otel_exporter_otlp_endpoint.py::Test_OTEL_EXPORTER_OTLP_ENDPOINT: missing_feature tests/parametric/otel_env_vars/test_otel_exporter_otlp_logs_endpoint.py::Test_OTEL_EXPORTER_OTLP_LOGS_ENDPOINT: missing_feature tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_endpoint.py::Test_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: missing_feature - tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py: missing_feature + ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py::Test_OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + : missing_feature tests/parametric/otel_env_vars/test_otel_exporter_otlp_traces_endpoint.py::Test_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: missing_feature tests/parametric/otel_env_vars/test_otel_logs_exporter.py::Test_OTEL_LOGS_EXPORTER: missing_feature tests/parametric/otel_env_vars/test_otel_metric_export_timeout.py::Test_OTEL_METRIC_EXPORT_TIMEOUT: missing_feature diff --git a/manifests/dotnet.yml b/manifests/dotnet.yml index 014861c75b0..5ee3c83252a 100644 --- a/manifests/dotnet.yml +++ b/manifests/dotnet.yml @@ -941,7 +941,10 @@ manifest: tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_endpoint.py::Test_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: v3.37.0 ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_endpoint.py::Test_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT::test_empty_falls_back_to_global_endpoint : bug (APMAPI-2509) - tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py: v3.29.0 + ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py::Test_OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + : v3.37.0 + ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py::Test_OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE::test_default_matches_specification + : missing_feature (Datadog intentionally defaults to Delta) tests/parametric/otel_env_vars/test_otel_exporter_otlp_traces_endpoint.py::Test_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: v3.41.0 tests/parametric/otel_env_vars/test_otel_logs_exporter.py::Test_OTEL_LOGS_EXPORTER: v3.37.0 tests/parametric/otel_env_vars/test_otel_logs_exporter.py::Test_OTEL_LOGS_EXPORTER::test_console: missing_feature (Only otlp and none exporters are implemented) diff --git a/manifests/golang.yml b/manifests/golang.yml index 9334e2d4ba7..d99074920c6 100644 --- a/manifests/golang.yml +++ b/manifests/golang.yml @@ -1963,6 +1963,14 @@ manifest: tests/parametric/otel_env_vars/test_otel_exporter_otlp_endpoint.py::Test_OTEL_EXPORTER_OTLP_ENDPOINT: v2.6.0 tests/parametric/otel_env_vars/test_otel_exporter_otlp_logs_endpoint.py::Test_OTEL_EXPORTER_OTLP_LOGS_ENDPOINT: v2.7.0 tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_endpoint.py::Test_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: v2.6.0 + ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py::Test_OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + : v2.5.0 + ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py::Test_OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE::test_default_matches_specification + : missing_feature (Datadog intentionally defaults to Delta) + ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py::Test_OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE::test_lowmemory + : missing_feature (LowMemory temporality is not implemented) + ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py::Test_OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE::test_lowmemory_case_insensitive + : missing_feature (LowMemory temporality is not implemented) tests/parametric/otel_env_vars/test_otel_exporter_otlp_traces_endpoint.py::Test_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: v2.8.0 tests/parametric/otel_env_vars/test_otel_logs_exporter.py::Test_OTEL_LOGS_EXPORTER: missing_feature (OTEL_LOGS_EXPORTER does not configure the logs pipeline) tests/parametric/otel_env_vars/test_otel_metric_export_timeout.py::Test_OTEL_METRIC_EXPORT_TIMEOUT: v2.5.0 diff --git a/manifests/java.yml b/manifests/java.yml index 6d4b86d98ea..f91ad57a39c 100644 --- a/manifests/java.yml +++ b/manifests/java.yml @@ -3960,7 +3960,10 @@ manifest: : bug (APMAPI-2412) ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_endpoint.py::Test_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT::test_otlp_metrics_custom_endpoint_grpc : bug (APMAPI-2503, APMAPI-2528) - tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py: '>=1.62.0' + ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py::Test_OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + : v1.56.0 + ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py::Test_OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE::test_default_matches_specification + : missing_feature (Datadog intentionally defaults to Delta) tests/parametric/otel_env_vars/test_otel_exporter_otlp_traces_endpoint.py::Test_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: v1.61.0 ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_traces_endpoint.py::Test_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT::test_empty_falls_back_to_global_endpoint : bug (APMAPI-2412) diff --git a/manifests/nodejs.yml b/manifests/nodejs.yml index 072bf33dbd3..a9c0f2aa149 100644 --- a/manifests/nodejs.yml +++ b/manifests/nodejs.yml @@ -2299,7 +2299,10 @@ manifest: tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_endpoint.py::Test_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: v5.83.0 ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_endpoint.py::Test_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT::test_otlp_metrics_custom_endpoint_grpc : missing_feature (Does not support grpc) - tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py: *ref_5_81_0 + ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py::Test_OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + : v5.83.0 + ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py::Test_OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE::test_default_matches_specification + : missing_feature (Datadog intentionally defaults to Delta) tests/parametric/otel_env_vars/test_otel_exporter_otlp_traces_endpoint.py::Test_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: v6.0.0 tests/parametric/otel_env_vars/test_otel_logs_exporter.py::Test_OTEL_LOGS_EXPORTER: missing_feature (OTEL_LOGS_EXPORTER does not configure the logs pipeline) tests/parametric/otel_env_vars/test_otel_metric_export_timeout.py::Test_OTEL_METRIC_EXPORT_TIMEOUT: v5.83.0 diff --git a/manifests/php.yml b/manifests/php.yml index a403de555b2..b1e4d74a494 100644 --- a/manifests/php.yml +++ b/manifests/php.yml @@ -1397,8 +1397,8 @@ manifest: tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_endpoint.py::Test_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: v1.23.0 ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_endpoint.py::Test_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT::test_otlp_metrics_custom_endpoint_grpc : missing_feature (Does not support grpc) - ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py::Test_Otel_Metrics_Configuration_Temporality_Preference - : missing_feature + ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py::Test_OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + : incomplete_test_app (Parametric app does not expose metric instrument endpoints) tests/parametric/otel_env_vars/test_otel_exporter_otlp_traces_endpoint.py::Test_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: missing_feature tests/parametric/otel_env_vars/test_otel_logs_exporter.py::Test_OTEL_LOGS_EXPORTER: v1.23.0 tests/parametric/otel_env_vars/test_otel_logs_exporter.py::Test_OTEL_LOGS_EXPORTER::test_deprecated_values: missing_feature (Deprecated logging exporter is not implemented) diff --git a/manifests/python.yml b/manifests/python.yml index b9945cb0d48..7c4ac85faba 100644 --- a/manifests/python.yml +++ b/manifests/python.yml @@ -1951,7 +1951,10 @@ manifest: tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_endpoint.py::Test_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: v4.11.0 ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_endpoint.py::Test_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT::test_empty_falls_back_to_global_endpoint : bug (APMAPI-2414) - tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py: v3.18.0 + ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py::Test_OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + : v4.11.0 + ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py::Test_OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE::test_default_matches_specification + : missing_feature (Datadog intentionally defaults to Delta) tests/parametric/otel_env_vars/test_otel_exporter_otlp_traces_endpoint.py::Test_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: v4.11.0 tests/parametric/otel_env_vars/test_otel_logs_exporter.py::Test_OTEL_LOGS_EXPORTER: # TODO: a lower version might be supported - declaration: missing_feature (OTEL_LOGS_EXPORTER does not configure the logs pipeline) diff --git a/manifests/ruby.yml b/manifests/ruby.yml index 6cfa7c49757..0be4dec4ec7 100644 --- a/manifests/ruby.yml +++ b/manifests/ruby.yml @@ -2338,9 +2338,12 @@ manifest: : bug (APMAPI-2413) ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_endpoint.py::Test_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT::test_otlp_metrics_custom_endpoint_grpc : missing_feature (Does not support grpc) - tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py: v2.24.0 - ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py::Test_Otel_Metrics_Configuration_Temporality_Preference::test_otel_aggregation_temporality - : missing_feature (default Histogram bucket ranges is not up to spec) + ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py::Test_OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + : v2.23.0 + ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py::Test_OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE::test_default_matches_specification + : missing_feature (Datadog intentionally defaults to Delta) + ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py::Test_OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE::test_exported_payload + : missing_feature (Gauge attributes and default Histogram buckets are not up to spec) tests/parametric/otel_env_vars/test_otel_exporter_otlp_traces_endpoint.py::Test_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: missing_feature tests/parametric/otel_env_vars/test_otel_logs_exporter.py::Test_OTEL_LOGS_EXPORTER: v2.34.0 tests/parametric/otel_env_vars/test_otel_logs_exporter.py::Test_OTEL_LOGS_EXPORTER::test_console: missing_feature (Only otlp and none exporters are implemented) diff --git a/manifests/rust.yml b/manifests/rust.yml index 720a15a3f49..4b9ca8e8e75 100644 --- a/manifests/rust.yml +++ b/manifests/rust.yml @@ -84,7 +84,10 @@ manifest: tests/parametric/otel_env_vars/test_otel_exporter_otlp_endpoint.py::Test_OTEL_EXPORTER_OTLP_ENDPOINT: v0.3.0 tests/parametric/otel_env_vars/test_otel_exporter_otlp_logs_endpoint.py::Test_OTEL_EXPORTER_OTLP_LOGS_ENDPOINT: v0.3.0 tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_endpoint.py::Test_OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: v0.3.0 - tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py: v0.3.0 + ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py::Test_OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + : v0.3.0 + ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py::Test_OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE::test_default_matches_specification + : missing_feature (Datadog intentionally defaults to Delta) tests/parametric/otel_env_vars/test_otel_exporter_otlp_traces_endpoint.py::Test_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: missing_feature tests/parametric/otel_env_vars/test_otel_logs_exporter.py::Test_OTEL_LOGS_EXPORTER: v0.3.0 tests/parametric/otel_env_vars/test_otel_logs_exporter.py::Test_OTEL_LOGS_EXPORTER::test_console: missing_feature (Only otlp and none exporters are implemented) diff --git a/tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py b/tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py index b91e167ba55..eefc411f76a 100644 --- a/tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py +++ b/tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py @@ -3,6 +3,8 @@ https://opentelemetry.io/docs/specs/otel/metrics/sdk_exporters/otlp/ """ +from typing import Final + from utils import features, pytest, scenarios from tests.parametric.conftest import APMLibrary from utils.docker_fixtures import TestAgentAPI @@ -23,74 +25,77 @@ get_expected_bucket_counts, ) +VARIABLE_NAME = "OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE" +LIBRARY_ENV: Final = { + **DEFAULT_ENVVARS, + VARIABLE_NAME: None, + "DD_OTLP_METRICS_TEMPORALITY_PREFERENCE": None, + # Setting this to none disables the entire Node.js tracer, including metrics. + "OTEL_TRACES_EXPORTER": None, + "OTEL_LOGS_EXPORTER": "none", + "OTEL_METRICS_EXPORTER": "otlp", + "OTEL_EXPORTER_OTLP_METRICS_PROTOCOL": "http/protobuf", +} -@scenarios.parametric -@features.otel_metrics_api -class Test_Otel_Metrics_Configuration_Temporality_Preference: - """Tests the OpenTelemetry metrics aggregation temporality preference configuration. +# One stable-value matrix, split into methods so manifests can distinguish +# missing LowMemory support from case-insensitive parsing gaps. +STABLE_VALUES: Final[tuple[tuple[str, str], ...]] = ( + ("cumulative", "cumulative"), + ("CUMULATIVE", "cumulative"), + ("CuMuLaTiVe", "cumulative"), + ("delta", "delta"), + ("DELTA", "delta"), + ("DeLtA", "delta"), + ("lowmemory", "lowmemory"), + ("LOWMEMORY", "lowmemory"), + ("LoWmEmOrY", "lowmemory"), +) - This class validates the behavior of temporality preference configuration: - - Default temporality behavior is set to DELTA - - Configuration of temporality preference through the OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE environment variable - - Proper instrument-specific aggregation temporality in exported metrics - """ - @pytest.mark.parametrize( - "library_env", - [ - { - **DEFAULT_ENVVARS, - }, - {**DEFAULT_ENVVARS, "OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE": "DELTA"}, - {**DEFAULT_ENVVARS, "OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE": "CUMULATIVE"}, - ], - ids=["default", "delta", "cumulative"], +def _assert_temporality( + test_agent: TestAgentAPI, + test_library: APMLibrary, + temporality_preference: str, + *, + check_payload: bool = False, +) -> None: + counter_name = f"test_otel_aggregation_temporality_counter-{temporality_preference.lower()}" + updowncounter_name = f"test_otel_aggregation_temporality_updowncounter-{temporality_preference.lower()}" + gauge_name = f"test_otel_aggregation_temporality_gauge-{temporality_preference.lower()}" + histogram_name = f"test_otel_aggregation_temporality_histogram-{temporality_preference.lower()}" + asynchronous_counter_name = ( + f"test_otel_aggregation_temporality_asynchronous_counter-{temporality_preference.lower()}" ) - def test_otel_aggregation_temporality( - self, library_env: dict[str, str], test_agent: TestAgentAPI, test_library: APMLibrary - ): - temporality_preference = library_env.get("OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE", "default") - - counter_name = f"test_otel_aggregation_temporality_counter-{temporality_preference.lower()}" - updowncounter_name = f"test_otel_aggregation_temporality_updowncounter-{temporality_preference.lower()}" - gauge_name = f"test_otel_aggregation_temporality_gauge-{temporality_preference.lower()}" - histogram_name = f"test_otel_aggregation_temporality_histogram-{temporality_preference.lower()}" - asynchronous_counter_name = ( - f"test_otel_aggregation_temporality_asynchronous_counter-{temporality_preference.lower()}" + asynchronous_updowncounter_name = ( + f"test_otel_aggregation_temporality_asynchronous_updowncounter-{temporality_preference.lower()}" + ) + asynchronous_gauge_name = f"test_otel_aggregation_temporality_asynchronous_gauge-{temporality_preference.lower()}" + + with test_library as t: + t.otel_get_meter(DEFAULT_METER_NAME, DEFAULT_METER_VERSION, DEFAULT_SCHEMA_URL, DEFAULT_SCOPE_ATTRIBUTES) + t.otel_create_counter(DEFAULT_METER_NAME, counter_name, DEFAULT_INSTRUMENT_UNIT, DEFAULT_INSTRUMENT_DESCRIPTION) + t.otel_counter_add( + DEFAULT_METER_NAME, + counter_name, + DEFAULT_INSTRUMENT_UNIT, + DEFAULT_INSTRUMENT_DESCRIPTION, + 42, + DEFAULT_MEASUREMENT_ATTRIBUTES, ) - asynchronous_updowncounter_name = ( - f"test_otel_aggregation_temporality_asynchronous_updowncounter-{temporality_preference.lower()}" + + t.otel_create_updowncounter( + DEFAULT_METER_NAME, updowncounter_name, DEFAULT_INSTRUMENT_UNIT, DEFAULT_INSTRUMENT_DESCRIPTION ) - asynchronous_gauge_name = ( - f"test_otel_aggregation_temporality_asynchronous_gauge-{temporality_preference.lower()}" + t.otel_updowncounter_add( + DEFAULT_METER_NAME, + updowncounter_name, + DEFAULT_INSTRUMENT_UNIT, + DEFAULT_INSTRUMENT_DESCRIPTION, + 42, + DEFAULT_MEASUREMENT_ATTRIBUTES, ) - with test_library as t: - t.otel_get_meter(DEFAULT_METER_NAME, DEFAULT_METER_VERSION, DEFAULT_SCHEMA_URL, DEFAULT_SCOPE_ATTRIBUTES) - t.otel_create_counter( - DEFAULT_METER_NAME, counter_name, DEFAULT_INSTRUMENT_UNIT, DEFAULT_INSTRUMENT_DESCRIPTION - ) - t.otel_counter_add( - DEFAULT_METER_NAME, - counter_name, - DEFAULT_INSTRUMENT_UNIT, - DEFAULT_INSTRUMENT_DESCRIPTION, - 42, - DEFAULT_MEASUREMENT_ATTRIBUTES, - ) - - t.otel_create_updowncounter( - DEFAULT_METER_NAME, updowncounter_name, DEFAULT_INSTRUMENT_UNIT, DEFAULT_INSTRUMENT_DESCRIPTION - ) - t.otel_updowncounter_add( - DEFAULT_METER_NAME, - updowncounter_name, - DEFAULT_INSTRUMENT_UNIT, - DEFAULT_INSTRUMENT_DESCRIPTION, - 42, - DEFAULT_MEASUREMENT_ATTRIBUTES, - ) - + if check_payload: t.otel_create_gauge(DEFAULT_METER_NAME, gauge_name, DEFAULT_INSTRUMENT_UNIT, DEFAULT_INSTRUMENT_DESCRIPTION) t.otel_gauge_record( DEFAULT_METER_NAME, @@ -101,36 +106,37 @@ def test_otel_aggregation_temporality( DEFAULT_MEASUREMENT_ATTRIBUTES, ) - t.otel_create_histogram( - DEFAULT_METER_NAME, histogram_name, DEFAULT_INSTRUMENT_UNIT, DEFAULT_INSTRUMENT_DESCRIPTION - ) - t.otel_histogram_record( - DEFAULT_METER_NAME, - histogram_name, - DEFAULT_INSTRUMENT_UNIT, - DEFAULT_INSTRUMENT_DESCRIPTION, - 42, - DEFAULT_MEASUREMENT_ATTRIBUTES, - ) + t.otel_create_histogram( + DEFAULT_METER_NAME, histogram_name, DEFAULT_INSTRUMENT_UNIT, DEFAULT_INSTRUMENT_DESCRIPTION + ) + t.otel_histogram_record( + DEFAULT_METER_NAME, + histogram_name, + DEFAULT_INSTRUMENT_UNIT, + DEFAULT_INSTRUMENT_DESCRIPTION, + 42, + DEFAULT_MEASUREMENT_ATTRIBUTES, + ) - t.otel_create_asynchronous_counter( - DEFAULT_METER_NAME, - asynchronous_counter_name, - DEFAULT_INSTRUMENT_UNIT, - DEFAULT_INSTRUMENT_DESCRIPTION, - 42, - DEFAULT_MEASUREMENT_ATTRIBUTES, - ) + t.otel_create_asynchronous_counter( + DEFAULT_METER_NAME, + asynchronous_counter_name, + DEFAULT_INSTRUMENT_UNIT, + DEFAULT_INSTRUMENT_DESCRIPTION, + 42, + DEFAULT_MEASUREMENT_ATTRIBUTES, + ) - t.otel_create_asynchronous_updowncounter( - DEFAULT_METER_NAME, - asynchronous_updowncounter_name, - DEFAULT_INSTRUMENT_UNIT, - DEFAULT_INSTRUMENT_DESCRIPTION, - 42, - DEFAULT_MEASUREMENT_ATTRIBUTES, - ) + t.otel_create_asynchronous_updowncounter( + DEFAULT_METER_NAME, + asynchronous_updowncounter_name, + DEFAULT_INSTRUMENT_UNIT, + DEFAULT_INSTRUMENT_DESCRIPTION, + 42, + DEFAULT_MEASUREMENT_ATTRIBUTES, + ) + if check_payload: t.otel_create_asynchronous_gauge( DEFAULT_METER_NAME, asynchronous_gauge_name, @@ -140,71 +146,162 @@ def test_otel_aggregation_temporality( DEFAULT_MEASUREMENT_ATTRIBUTES, ) - t.otel_metrics_force_flush() - - metrics = test_agent.wait_for_num_otlp_metrics(num=1) - scope_metrics = metrics[0]["resource_metrics"][0]["scope_metrics"] - assert scope_metrics is not None - - counter = find_metric_by_name(scope_metrics[0], counter_name) - assert_sum_aggregation( - counter["sum"], - "AGGREGATION_TEMPORALITY_CUMULATIVE" - if temporality_preference == "CUMULATIVE" - else "AGGREGATION_TEMPORALITY_DELTA", - is_monotonic=True, - value=42, - attributes=DEFAULT_MEASUREMENT_ATTRIBUTES, - ) + t.otel_metrics_force_flush() - updowncounter = find_metric_by_name(scope_metrics[0], updowncounter_name) - assert_sum_aggregation( - updowncounter["sum"], - "AGGREGATION_TEMPORALITY_CUMULATIVE", - is_monotonic=False, - value=42, - attributes=DEFAULT_MEASUREMENT_ATTRIBUTES, - ) + metrics = test_agent.wait_for_num_otlp_metrics(num=1) + scope_metrics = metrics[0]["resource_metrics"][0]["scope_metrics"] + assert scope_metrics is not None - # Note: Temporality does not affect the OTLP metric for Gauges - gauge = find_metric_by_name(scope_metrics[0], gauge_name) - assert_gauge_aggregation(gauge["gauge"], 42, DEFAULT_MEASUREMENT_ATTRIBUTES) - - histogram = find_metric_by_name(scope_metrics[0], histogram_name) - assert_histogram_aggregation( - histogram["histogram"], - "AGGREGATION_TEMPORALITY_CUMULATIVE" - if temporality_preference == "CUMULATIVE" - else "AGGREGATION_TEMPORALITY_DELTA", - count=1, - sum_value=42, - min_value=42, - max_value=42, - bucket_boundaries=DEFAULT_EXPLICIT_BUCKET_BOUNDARIES, - bucket_counts=get_expected_bucket_counts([42], DEFAULT_EXPLICIT_BUCKET_BOUNDARIES), - attributes=DEFAULT_MEASUREMENT_ATTRIBUTES, - ) + expected_sync = "CUMULATIVE" if temporality_preference == "cumulative" else "DELTA" + expected_async = "DELTA" if temporality_preference == "delta" else "CUMULATIVE" + for name, aggregation, expected in ( + (counter_name, "sum", expected_sync), + (histogram_name, "histogram", expected_sync), + (asynchronous_counter_name, "sum", expected_async), + (updowncounter_name, "sum", "CUMULATIVE"), + (asynchronous_updowncounter_name, "sum", "CUMULATIVE"), + ): + metric = find_metric_by_name(scope_metrics[0], name) + assert metric[aggregation]["aggregation_temporality"] == f"AGGREGATION_TEMPORALITY_{expected}", name + if not check_payload: + return - asynchronous_counter = find_metric_by_name(scope_metrics[0], asynchronous_counter_name) - assert_sum_aggregation( - asynchronous_counter["sum"], - "AGGREGATION_TEMPORALITY_DELTA" - if temporality_preference in ("DELTA", "default") - else "AGGREGATION_TEMPORALITY_CUMULATIVE", - is_monotonic=True, - value=42, - attributes=DEFAULT_MEASUREMENT_ATTRIBUTES, - ) + counter = find_metric_by_name(scope_metrics[0], counter_name) + assert_sum_aggregation( + counter["sum"], + "AGGREGATION_TEMPORALITY_CUMULATIVE" + if temporality_preference == "cumulative" + else "AGGREGATION_TEMPORALITY_DELTA", + is_monotonic=True, + value=42, + attributes=DEFAULT_MEASUREMENT_ATTRIBUTES, + ) - asynchronous_updowncounter = find_metric_by_name(scope_metrics[0], asynchronous_updowncounter_name) - assert_sum_aggregation( - asynchronous_updowncounter["sum"], - "AGGREGATION_TEMPORALITY_CUMULATIVE", - is_monotonic=False, - value=42, - attributes=DEFAULT_MEASUREMENT_ATTRIBUTES, - ) + updowncounter = find_metric_by_name(scope_metrics[0], updowncounter_name) + assert_sum_aggregation( + updowncounter["sum"], + "AGGREGATION_TEMPORALITY_CUMULATIVE", + is_monotonic=False, + value=42, + attributes=DEFAULT_MEASUREMENT_ATTRIBUTES, + ) + + # Note: Temporality does not affect the OTLP metric for Gauges + gauge = find_metric_by_name(scope_metrics[0], gauge_name) + assert_gauge_aggregation(gauge["gauge"], 42, DEFAULT_MEASUREMENT_ATTRIBUTES) + + histogram = find_metric_by_name(scope_metrics[0], histogram_name) + assert_histogram_aggregation( + histogram["histogram"], + "AGGREGATION_TEMPORALITY_CUMULATIVE" + if temporality_preference == "cumulative" + else "AGGREGATION_TEMPORALITY_DELTA", + count=1, + sum_value=42, + min_value=42, + max_value=42, + bucket_boundaries=DEFAULT_EXPLICIT_BUCKET_BOUNDARIES, + bucket_counts=get_expected_bucket_counts([42], DEFAULT_EXPLICIT_BUCKET_BOUNDARIES), + attributes=DEFAULT_MEASUREMENT_ATTRIBUTES, + ) + + asynchronous_counter = find_metric_by_name(scope_metrics[0], asynchronous_counter_name) + assert_sum_aggregation( + asynchronous_counter["sum"], + "AGGREGATION_TEMPORALITY_DELTA" if temporality_preference == "delta" else "AGGREGATION_TEMPORALITY_CUMULATIVE", + is_monotonic=True, + value=42, + attributes=DEFAULT_MEASUREMENT_ATTRIBUTES, + ) + + asynchronous_updowncounter = find_metric_by_name(scope_metrics[0], asynchronous_updowncounter_name) + assert_sum_aggregation( + asynchronous_updowncounter["sum"], + "AGGREGATION_TEMPORALITY_CUMULATIVE", + is_monotonic=False, + value=42, + attributes=DEFAULT_MEASUREMENT_ATTRIBUTES, + ) + + # Note: Temporality does not affect the OTLP metric for Gauges + asynchronous_gauge = find_metric_by_name(scope_metrics[0], asynchronous_gauge_name) + assert_gauge_aggregation(asynchronous_gauge["gauge"], 42, DEFAULT_MEASUREMENT_ATTRIBUTES) + + +@scenarios.parametric +@features.otel_exporter_otlp_metrics_temporality_preference +class Test_OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE: + @pytest.mark.parametrize( + ("library_env", "expected"), + [ + pytest.param({**LIBRARY_ENV, VARIABLE_NAME: wire}, expected, id=wire) + for wire, expected in STABLE_VALUES + if expected != "lowmemory" and wire in (wire.lower(), wire.upper()) + ], + ) + def test_stable_values(self, test_agent: TestAgentAPI, test_library: APMLibrary, expected: str) -> None: + _assert_temporality(test_agent, test_library, expected) - # Note: Temporality does not affect the OTLP metric for Gauges - asynchronous_gauge = find_metric_by_name(scope_metrics[0], asynchronous_gauge_name) - assert_gauge_aggregation(asynchronous_gauge["gauge"], 42, DEFAULT_MEASUREMENT_ATTRIBUTES) + @pytest.mark.parametrize( + ("library_env", "expected"), + [ + pytest.param({**LIBRARY_ENV, VARIABLE_NAME: wire}, expected, id=wire) + for wire, expected in STABLE_VALUES + if expected == "lowmemory" and wire in (wire.lower(), wire.upper()) + ], + ) + def test_lowmemory(self, test_agent: TestAgentAPI, test_library: APMLibrary, expected: str) -> None: + _assert_temporality(test_agent, test_library, expected) + + @pytest.mark.parametrize( + ("library_env", "expected"), + [ + pytest.param({**LIBRARY_ENV, VARIABLE_NAME: wire}, expected, id=wire) + for wire, expected in STABLE_VALUES + if expected != "lowmemory" and wire not in (wire.lower(), wire.upper()) + ], + ) + def test_case_insensitive(self, test_agent: TestAgentAPI, test_library: APMLibrary, expected: str) -> None: + _assert_temporality(test_agent, test_library, expected) + + @pytest.mark.parametrize( + ("library_env", "expected"), + [ + pytest.param({**LIBRARY_ENV, VARIABLE_NAME: wire}, expected, id=wire) + for wire, expected in STABLE_VALUES + if expected == "lowmemory" and wire not in (wire.lower(), wire.upper()) + ], + ) + def test_lowmemory_case_insensitive( + self, test_agent: TestAgentAPI, test_library: APMLibrary, expected: str + ) -> None: + _assert_temporality(test_agent, test_library, expected) + + @pytest.mark.parametrize("library_env", [pytest.param(LIBRARY_ENV, id="unset")]) + def test_default_matches_specification(self, test_agent: TestAgentAPI, test_library: APMLibrary) -> None: + _assert_temporality(test_agent, test_library, "cumulative") + + @pytest.mark.parametrize("library_env", [pytest.param(LIBRARY_ENV, id="unset")]) + def test_datadog_default(self, test_agent: TestAgentAPI, test_library: APMLibrary) -> None: + """Preserve the documented Datadog Delta default separately from OTel compliance.""" + _assert_temporality(test_agent, test_library, "delta") + + @pytest.mark.parametrize("library_env", [pytest.param({**LIBRARY_ENV, VARIABLE_NAME: ""}, id="empty")]) + def test_empty_is_treated_as_unset(self, test_agent: TestAgentAPI, test_library: APMLibrary) -> None: + _assert_temporality(test_agent, test_library, "delta") + + @pytest.mark.parametrize("library_env", [pytest.param({**LIBRARY_ENV, VARIABLE_NAME: "invalid"}, id="invalid")]) + def test_invalid_value_is_ignored(self, test_agent: TestAgentAPI, test_library: APMLibrary) -> None: + _assert_temporality(test_agent, test_library, "delta") + + @pytest.mark.parametrize( + ("library_env", "expected"), + [ + pytest.param(LIBRARY_ENV, "delta", id="unset"), + pytest.param({**LIBRARY_ENV, VARIABLE_NAME: "DELTA"}, "delta", id="DELTA"), + pytest.param({**LIBRARY_ENV, VARIABLE_NAME: "CUMULATIVE"}, "cumulative", id="CUMULATIVE"), + ], + ) + def test_exported_payload(self, test_agent: TestAgentAPI, test_library: APMLibrary, expected: str) -> None: + """Preserve the original test's values, attributes, timestamps, and histogram buckets.""" + _assert_temporality(test_agent, test_library, expected, check_payload=True) diff --git a/utils/_features.py b/utils/_features.py index 0cd8b4acf13..c525cf23bac 100644 --- a/utils/_features.py +++ b/utils/_features.py @@ -3341,6 +3341,14 @@ def otel_exporter_otlp_metrics_protocol(test_object): """ return _mark_test_object(test_object, feature_id=604, owner=_Owner.sdk_capabilities) + @staticmethod + def otel_exporter_otlp_metrics_temporality_preference(test_object): + """OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE + + https://feature-parity.us1.prod.dog/#/?feature=645 + """ + return _mark_test_object(test_object, feature_id=645, owner=_Owner.sdk_capabilities) + @staticmethod def otel_exporter_otlp_metrics_timeout(test_object): """OTEL_EXPORTER_OTLP_METRICS_TIMEOUT From 37f590e4674cf31bd30f4db7d3217cb721462e48 Mon Sep 17 00:00:00 2001 From: Victor Pellan Date: Fri, 2 Oct 2026 17:13:32 +0200 Subject: [PATCH 2/3] Declare temporality compliance gaps by language --- manifests/dotnet.yml | 4 ++++ manifests/python.yml | 2 ++ manifests/ruby.yml | 8 ++++++++ manifests/rust.yml | 4 ++++ ...orter_otlp_metrics_temporality_preference.py | 17 +++++++++++++++-- 5 files changed, 33 insertions(+), 2 deletions(-) diff --git a/manifests/dotnet.yml b/manifests/dotnet.yml index 5ee3c83252a..e28efa7f319 100644 --- a/manifests/dotnet.yml +++ b/manifests/dotnet.yml @@ -945,6 +945,10 @@ manifest: : v3.37.0 ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py::Test_OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE::test_default_matches_specification : missing_feature (Datadog intentionally defaults to Delta) + ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py::Test_OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE::test_lowmemory + : bug (APMAPI-2563) + ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py::Test_OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE::test_lowmemory_case_insensitive + : bug (APMAPI-2563) tests/parametric/otel_env_vars/test_otel_exporter_otlp_traces_endpoint.py::Test_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: v3.41.0 tests/parametric/otel_env_vars/test_otel_logs_exporter.py::Test_OTEL_LOGS_EXPORTER: v3.37.0 tests/parametric/otel_env_vars/test_otel_logs_exporter.py::Test_OTEL_LOGS_EXPORTER::test_console: missing_feature (Only otlp and none exporters are implemented) diff --git a/manifests/python.yml b/manifests/python.yml index 7c4ac85faba..f174bce2c74 100644 --- a/manifests/python.yml +++ b/manifests/python.yml @@ -1955,6 +1955,8 @@ manifest: : v4.11.0 ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py::Test_OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE::test_default_matches_specification : missing_feature (Datadog intentionally defaults to Delta) + ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py::Test_OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE::test_invalid_value_is_ignored + : bug (APMAPI-2565) tests/parametric/otel_env_vars/test_otel_exporter_otlp_traces_endpoint.py::Test_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: v4.11.0 tests/parametric/otel_env_vars/test_otel_logs_exporter.py::Test_OTEL_LOGS_EXPORTER: # TODO: a lower version might be supported - declaration: missing_feature (OTEL_LOGS_EXPORTER does not configure the logs pipeline) diff --git a/manifests/ruby.yml b/manifests/ruby.yml index 0be4dec4ec7..9ad15c08930 100644 --- a/manifests/ruby.yml +++ b/manifests/ruby.yml @@ -2342,8 +2342,16 @@ manifest: : v2.23.0 ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py::Test_OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE::test_default_matches_specification : missing_feature (Datadog intentionally defaults to Delta) + ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py::Test_OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE::test_delta_case_insensitive + : bug (APMAPI-2566) + ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py::Test_OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE::test_empty_is_treated_as_unset + : bug (APMAPI-2566) ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py::Test_OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE::test_exported_payload : missing_feature (Gauge attributes and default Histogram buckets are not up to spec) + ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py::Test_OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE::test_invalid_value_is_ignored + : bug (APMAPI-2566) + ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py::Test_OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE::test_lowmemory_case_insensitive + : bug (APMAPI-2566) tests/parametric/otel_env_vars/test_otel_exporter_otlp_traces_endpoint.py::Test_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: missing_feature tests/parametric/otel_env_vars/test_otel_logs_exporter.py::Test_OTEL_LOGS_EXPORTER: v2.34.0 tests/parametric/otel_env_vars/test_otel_logs_exporter.py::Test_OTEL_LOGS_EXPORTER::test_console: missing_feature (Only otlp and none exporters are implemented) diff --git a/manifests/rust.yml b/manifests/rust.yml index 4b9ca8e8e75..f5e1cbc90a4 100644 --- a/manifests/rust.yml +++ b/manifests/rust.yml @@ -88,6 +88,10 @@ manifest: : v0.3.0 ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py::Test_OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE::test_default_matches_specification : missing_feature (Datadog intentionally defaults to Delta) + ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py::Test_OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE::test_lowmemory + : bug (APMAPI-2564) + ? tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py::Test_OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE::test_lowmemory_case_insensitive + : bug (APMAPI-2564) tests/parametric/otel_env_vars/test_otel_exporter_otlp_traces_endpoint.py::Test_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: missing_feature tests/parametric/otel_env_vars/test_otel_logs_exporter.py::Test_OTEL_LOGS_EXPORTER: v0.3.0 tests/parametric/otel_env_vars/test_otel_logs_exporter.py::Test_OTEL_LOGS_EXPORTER::test_console: missing_feature (Only otlp and none exporters are implemented) diff --git a/tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py b/tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py index eefc411f76a..491a7669abd 100644 --- a/tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py +++ b/tests/parametric/otel_env_vars/test_otel_exporter_otlp_metrics_temporality_preference.py @@ -258,10 +258,23 @@ def test_lowmemory(self, test_agent: TestAgentAPI, test_library: APMLibrary, exp [ pytest.param({**LIBRARY_ENV, VARIABLE_NAME: wire}, expected, id=wire) for wire, expected in STABLE_VALUES - if expected != "lowmemory" and wire not in (wire.lower(), wire.upper()) + if expected == "cumulative" and wire not in (wire.lower(), wire.upper()) ], ) - def test_case_insensitive(self, test_agent: TestAgentAPI, test_library: APMLibrary, expected: str) -> None: + def test_cumulative_case_insensitive( + self, test_agent: TestAgentAPI, test_library: APMLibrary, expected: str + ) -> None: + _assert_temporality(test_agent, test_library, expected) + + @pytest.mark.parametrize( + ("library_env", "expected"), + [ + pytest.param({**LIBRARY_ENV, VARIABLE_NAME: wire}, expected, id=wire) + for wire, expected in STABLE_VALUES + if expected == "delta" and wire not in (wire.lower(), wire.upper()) + ], + ) + def test_delta_case_insensitive(self, test_agent: TestAgentAPI, test_library: APMLibrary, expected: str) -> None: _assert_temporality(test_agent, test_library, expected) @pytest.mark.parametrize( From 8b6e312acfc631903448518aaff581d272e2f7b6 Mon Sep 17 00:00:00 2001 From: Victor Pellan Date: Fri, 2 Oct 2026 17:13:34 +0200 Subject: [PATCH 3/3] Wait for trace delivery in invalid regex filter test --- tests/parametric/test_trace_filters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/parametric/test_trace_filters.py b/tests/parametric/test_trace_filters.py index 7785270b84e..667878ac00f 100644 --- a/tests/parametric/test_trace_filters.py +++ b/tests/parametric/test_trace_filters.py @@ -177,7 +177,7 @@ def test_trace_filters_invalid_reject_regex(self, test_agent: TestAgentAPI, test test_library.dd_start_span(name="web.request", tags=[("reject_tag", "[invalid")]), ): pass - assert len(test_agent.traces()) == 1, "trace kept: invalid regex filter is dropped" + assert len(test_agent.wait_for_num_traces(1)) == 1, "trace kept: invalid regex filter is dropped" @enable_tracestats() @enable_trace_filters(reject=[" \treject_tag \t:\t true\t "])