diff --git a/Cargo.lock b/Cargo.lock index e99f11eddf4..fda19a36c42 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2779,7 +2779,7 @@ dependencies = [ [[package]] name = "libdd-common" -version = "4.2.0" +version = "5.0.0" dependencies = [ "anyhow", "bytes", @@ -2923,6 +2923,7 @@ dependencies = [ "libdd-trace-protobuf", "libdd-trace-stats", "libdd-trace-utils", + "prost", "rand 0.8.5", "regex", "rmp-serde", @@ -3071,7 +3072,7 @@ dependencies = [ [[package]] name = "libdd-remote-config" -version = "0.1.0" +version = "1.0.0" dependencies = [ "anyhow", "base64 0.22.1", @@ -3257,6 +3258,7 @@ dependencies = [ "flate2", "futures", "getrandom 0.2.15", + "hex", "http", "http-body", "http-body-util", diff --git a/Makefile b/Makefile index a48ff351cd9..aa1ba9dad6f 100644 --- a/Makefile +++ b/Makefile @@ -44,7 +44,7 @@ TRACER_SOURCES_INI := -d datadog.trace.sources_path=$(TRACER_SOURCE_DIR) RUN_TESTS_IS_PARALLEL ?= $(shell test $(PHP_MAJOR_MINOR) -ge 74 && echo 1) # shuffle parallel tests to evenly distribute test load, avoiding a batch of 32 tests being request-replayer tests -RUN_TESTS_CMD := DD_SERVICE= DD_ENV= DD_TRACE_RETRY_INTERVAL=1 REPORT_EXIT_STATUS=1 TEST_PHP_SRCDIR=$(PROJECT_ROOT) USE_TRACKED_ALLOC=1 php -n -d 'memory_limit=-1' $(BUILD_DIR)/run-tests.php $(if $(QUIET_TESTS),,-g FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP) $(if $(ASAN), --asan) --show-diff -n -p $(shell which php) -q $(if $(RUN_TESTS_IS_PARALLEL), --shuffle -j$(MAX_TEST_PARALLELISM)) +RUN_TESTS_CMD := DD_SERVICE= DD_ENV= REPORT_EXIT_STATUS=1 TEST_PHP_SRCDIR=$(PROJECT_ROOT) USE_TRACKED_ALLOC=1 php -n -d 'memory_limit=-1' $(BUILD_DIR)/run-tests.php $(if $(QUIET_TESTS),,-g FAIL,XFAIL,BORK,WARN,LEAK,XLEAK,SKIP) $(if $(ASAN), --asan) --show-diff -n -p $(shell which php) -q $(if $(RUN_TESTS_IS_PARALLEL), --shuffle -j$(MAX_TEST_PARALLELISM)) C_FILES = $(shell find components components-rs ext src/dogstatsd tracer zend_abstract_interface -name '*.c' -o -name '*.h' | awk '{ printf "$(BUILD_DIR)/%s\n", $$1 }' ) TEST_FILES = $(shell find tests/ext -name '*.php*' -o -name '*.inc' -o -name '*.json' -o -name '*.yaml' -o -name 'CONFLICTS' | awk '{ printf "$(BUILD_DIR)/%s\n", $$1 }' ) @@ -211,7 +211,7 @@ test_extension_ci: $(SO_FILE) $(TEST_FILES) $(TEST_STUB_FILES) $(BUILD_DIR)/run- \ export TEST_PHP_JUNIT=$(JUNIT_RESULTS_DIR)/valgrind-extension-test.xml; \ export TEST_PHP_OUTPUT=$(JUNIT_RESULTS_DIR)/valgrind-run-tests.out; \ - DD_SPAWN_WORKER_STABLE_TRAMPOLINE=1 $(ALL_TEST_ENV_OVERRIDE) $(RUN_TESTS_CMD) -d extension=$(SO_FILE) -m -s $$TEST_PHP_OUTPUT $(BUILD_DIR)/$(TESTS) && ! grep -e '^LEAKED TEST SUMMARY' $$TEST_PHP_OUTPUT; \ + DD_SPAWN_WORKER_STABLE_TRAMPOLINE=1 $(ALL_TEST_ENV_OVERRIDE) DD_TRACE_AGENT_TIMEOUT=5000 $(RUN_TESTS_CMD) -d extension=$(SO_FILE) -m -s $$TEST_PHP_OUTPUT $(BUILD_DIR)/$(TESTS) && ! grep -e '^LEAKED TEST SUMMARY' $$TEST_PHP_OUTPUT; \ ) build_tea: TEA_BUILD_TESTS=ON diff --git a/ext/configuration.h b/ext/configuration.h index f3d1b811db9..03fd38f7045 100644 --- a/ext/configuration.h +++ b/ext/configuration.h @@ -28,7 +28,7 @@ enum datadog_sidecar_connection_mode { * A user hit an issue with the userland time of 100. */ #define DD_TRACE_AGENT_CONNECT_TIMEOUT_VAL 100 -#define DD_TRACE_AGENT_TIMEOUT_VAL 500 +#define DD_TRACE_AGENT_TIMEOUT_VAL 3000 #define DD_TRACE_AGENT_FLUSH_INTERVAL_VAL 1001 #define DD_CFG_STR(str) #str diff --git a/ext/sidecar.c b/ext/sidecar.c index 88df83479a9..224774d3a55 100644 --- a/ext/sidecar.c +++ b/ext/sidecar.c @@ -616,6 +616,7 @@ ddog_Endpoint *datadog_sidecar_agent_endpoint(void) { if (agent_endpoint) { dd_set_endpoint_test_token(agent_endpoint); + ddog_endpoint_set_timeout(agent_endpoint, get_global_DD_TRACE_AGENT_TIMEOUT()); } return agent_endpoint; diff --git a/metadata/supported-configurations.json b/metadata/supported-configurations.json index e589ee49431..cf69a9bffc4 100644 --- a/metadata/supported-configurations.json +++ b/metadata/supported-configurations.json @@ -781,7 +781,7 @@ { "implementation": "B", "type": "int", - "default": "500" + "default": "3000" } ], "DD_TRACE_AGENT_URL": [ diff --git a/tests/ext/appsec/sca_flag_is_sent_01.phpt b/tests/ext/appsec/sca_flag_is_sent_01.phpt index bc8a4a35d84..dec47246c15 100644 --- a/tests/ext/appsec/sca_flag_is_sent_01.phpt +++ b/tests/ext/appsec/sca_flag_is_sent_01.phpt @@ -12,6 +12,8 @@ require __DIR__ . '/../includes/clear_skipif_telemetry.inc' --ENV-- DD_TRACE_GENERATE_ROOT_SPAN=0 DD_INSTRUMENTATION_TELEMETRY_ENABLED=1 +DD_TRACE_AGENT_TIMEOUT=200 +DD_TRACE_RETRY_INTERVAL=1 --INI-- datadog.trace.agent_url="file://{PWD}/sca_flag_is_sent_01-telemetry.out" --FILE_EXTERNAL-- diff --git a/tests/ext/appsec/sca_flag_is_sent_02.phpt b/tests/ext/appsec/sca_flag_is_sent_02.phpt index d400ff4aa1b..0bf28f1d14c 100644 --- a/tests/ext/appsec/sca_flag_is_sent_02.phpt +++ b/tests/ext/appsec/sca_flag_is_sent_02.phpt @@ -13,6 +13,8 @@ require __DIR__ . '/../includes/clear_skipif_telemetry.inc' DD_TRACE_GENERATE_ROOT_SPAN=0 DD_INSTRUMENTATION_TELEMETRY_ENABLED=1 DD_APPSEC_SCA_ENABLED=true +DD_TRACE_AGENT_TIMEOUT=200 +DD_TRACE_RETRY_INTERVAL=1 --INI-- datadog.trace.agent_url="file://{PWD}/sca_flag_is_sent_02-telemetry.out" --FILE_EXTERNAL-- diff --git a/tests/ext/appsec/sca_flag_is_sent_03.phpt b/tests/ext/appsec/sca_flag_is_sent_03.phpt index a989d3e7388..11164a0670c 100644 --- a/tests/ext/appsec/sca_flag_is_sent_03.phpt +++ b/tests/ext/appsec/sca_flag_is_sent_03.phpt @@ -13,6 +13,8 @@ require __DIR__ . '/../includes/clear_skipif_telemetry.inc' DD_TRACE_GENERATE_ROOT_SPAN=0 DD_INSTRUMENTATION_TELEMETRY_ENABLED=1 DD_APPSEC_SCA_ENABLED=false +DD_TRACE_AGENT_TIMEOUT=200 +DD_TRACE_RETRY_INTERVAL=1 --INI-- datadog.trace.agent_url="file://{PWD}/sca_flag_is_sent_03-telemetry.out" --FILE_EXTERNAL-- diff --git a/tests/ext/appsec/sca_flag_is_sent_04.phpt b/tests/ext/appsec/sca_flag_is_sent_04.phpt index e0ce9d59395..18270a8a63b 100644 --- a/tests/ext/appsec/sca_flag_is_sent_04.phpt +++ b/tests/ext/appsec/sca_flag_is_sent_04.phpt @@ -12,6 +12,8 @@ require __DIR__ . '/../includes/clear_skipif_telemetry.inc' --ENV-- DD_TRACE_GENERATE_ROOT_SPAN=0 DD_INSTRUMENTATION_TELEMETRY_ENABLED=1 +DD_TRACE_AGENT_TIMEOUT=200 +DD_TRACE_RETRY_INTERVAL=1 --INI-- datadog.trace.agent_url="file://{PWD}/sca_flag_is_sent_04-telemetry.out" datadog.appsec.sca_enabled=1 diff --git a/tests/ext/appsec/sca_flag_is_sent_05.phpt b/tests/ext/appsec/sca_flag_is_sent_05.phpt index 73f06a8ce8f..3f33dceffe8 100644 --- a/tests/ext/appsec/sca_flag_is_sent_05.phpt +++ b/tests/ext/appsec/sca_flag_is_sent_05.phpt @@ -12,6 +12,8 @@ require __DIR__ . '/../includes/clear_skipif_telemetry.inc' --ENV-- DD_TRACE_GENERATE_ROOT_SPAN=0 DD_INSTRUMENTATION_TELEMETRY_ENABLED=1 +DD_TRACE_AGENT_TIMEOUT=200 +DD_TRACE_RETRY_INTERVAL=1 --INI-- datadog.trace.agent_url="file://{PWD}/sca_flag_is_sent_05-telemetry.out" datadog.appsec.sca_enabled=0 diff --git a/tests/ext/background-sender/agent_headers_unix_domain_socket.phpt b/tests/ext/background-sender/agent_headers_unix_domain_socket.phpt index 1293e47be72..040b4d15b2f 100644 --- a/tests/ext/background-sender/agent_headers_unix_domain_socket.phpt +++ b/tests/ext/background-sender/agent_headers_unix_domain_socket.phpt @@ -25,6 +25,9 @@ $proxy = RequestReplayer::launchUnixProxy(str_replace("unix://", "", getenv("DD_ \DDTrace\start_span(); \DDTrace\close_span(); +// ensure the response also is received by the sender first, to avoid retries holding up other tests +dd_trace_internal_fn("synchronous_flush"); + echo PHP_EOL; $headers = $rr->replayHeaders([ 'content-type', diff --git a/tests/ext/background-sender/background_sender_ipv6_support.phpt b/tests/ext/background-sender/background_sender_ipv6_support.phpt index 06405102053..df66ad29d2f 100644 --- a/tests/ext/background-sender/background_sender_ipv6_support.phpt +++ b/tests/ext/background-sender/background_sender_ipv6_support.phpt @@ -9,6 +9,8 @@ include_once __DIR__ . '/../startup_logging.inc'; $logs = dd_get_startup_logs([], [ 'DD_AGENT_HOST' => '::1', 'DD_TRACE_DEBUG' => 1, + 'DD_TRACE_AGENT_TIMEOUT' => 200, + 'DD_TRACE_RETRY_INTERVAL' => 1, ]); dd_dump_startup_logs($logs, [ diff --git a/tests/ext/background-sender/cli_shutdown_no_hang_unreachable_agent.phpt b/tests/ext/background-sender/cli_shutdown_no_hang_unreachable_agent.phpt index 79361ae474d..759b6d1f5ff 100644 --- a/tests/ext/background-sender/cli_shutdown_no_hang_unreachable_agent.phpt +++ b/tests/ext/background-sender/cli_shutdown_no_hang_unreachable_agent.phpt @@ -18,8 +18,9 @@ DD_AGENT_HOST=192.0.2.1 DD_TRACE_AGENT_PORT=18126 DD_TRACE_SIDECAR_TRACE_SENDER=0 DD_TRACE_SHUTDOWN_TIMEOUT=2000 -DD_TRACE_AGENT_TIMEOUT=500 -DD_TRACE_AGENT_CONNECT_TIMEOUT=500 +DD_TRACE_AGENT_TIMEOUT=200 +DD_TRACE_AGENT_CONNECT_TIMEOUT=200 +DD_TRACE_RETRY_INTERVAL=1 DD_TRACE_AGENT_RETRIES=0 DD_INSTRUMENTATION_TELEMETRY_ENABLED=0 DD_REMOTE_CONFIG_ENABLED=0 diff --git a/tests/ext/background-sender/default_unix_domain_socket_agent.phpt b/tests/ext/background-sender/default_unix_domain_socket_agent.phpt index 8b08b338e03..e5feeb9b91a 100644 --- a/tests/ext/background-sender/default_unix_domain_socket_agent.phpt +++ b/tests/ext/background-sender/default_unix_domain_socket_agent.phpt @@ -6,6 +6,9 @@ If an agent unix domain socket exists it will try to connect to it --ENV-- +DD_TRACE_GENERATE_ROOT_SPAN=0 +DD_INSTRUMENTATION_TELEMETRY_ENABLED=0 +DD_REMOTE_CONFIG_ENABLED=0 DD_AGENT_HOST= --FILE-- true]); } @@ -24,6 +24,10 @@ if (!ini_get("datadog.trace.enabled")) { dd_trace_internal_fn("await_remote_config"); } +if (!$child) { + pcntl_wait($status); +} + print ini_get("datadog.trace.enabled"); ?> diff --git a/tests/ext/request-replayer/dd_trace_agent_env.phpt b/tests/ext/request-replayer/dd_trace_agent_env.phpt index 50de644e70a..855da2ab544 100644 --- a/tests/ext/request-replayer/dd_trace_agent_env.phpt +++ b/tests/ext/request-replayer/dd_trace_agent_env.phpt @@ -37,11 +37,7 @@ $rr = new RequestReplayer(); $span = \DDTrace\start_span(); // make sure sidecar keeps up with us -$start = microtime(true); -\DDTrace\start_trace_span(); -\DDTrace\close_span(); -$rr->waitForDataAndReplay(); -usleep(floor(microtime(true) - $start) * 100000); +dd_trace_internal_fn('await_agent_info'); \DDTrace\close_span(); var_dump($span->env); diff --git a/tests/ext/startup_logging_diagnostics.phpt b/tests/ext/startup_logging_diagnostics.phpt index ccc6d506bee..d278990e7c9 100644 --- a/tests/ext/startup_logging_diagnostics.phpt +++ b/tests/ext/startup_logging_diagnostics.phpt @@ -11,6 +11,8 @@ $args = [ ]; $env = [ 'DD_TRACE_DEBUG' => '1', + 'DD_TRACE_AGENT_TIMEOUT' => 200, + 'DD_TRACE_RETRY_INTERVAL' => 1, 'DD_AGENT_HOST' => 'invalid_host', 'DD_SERVICE' => 'foo_service', 'DD_TAGS' => 'foo:tag', diff --git a/tests/ext/telemetry/broken_pipe.phpt b/tests/ext/telemetry/broken_pipe.phpt index 425770418ca..64646243a78 100644 --- a/tests/ext/telemetry/broken_pipe.phpt +++ b/tests/ext/telemetry/broken_pipe.phpt @@ -11,6 +11,8 @@ require __DIR__ . '/../includes/clear_skipif_telemetry.inc' DD_TRACE_GENERATE_ROOT_SPAN=0 DD_INSTRUMENTATION_TELEMETRY_ENABLED=1 DD_TRACE_LOG_LEVEL=info,startup=off +DD_TRACE_AGENT_TIMEOUT=200 +DD_TRACE_RETRY_INTERVAL=1 --INI-- datadog.trace.agent_url="file://{PWD}/broken_pipe-telemetry.out" --FILE-- diff --git a/tests/ext/telemetry/composer.phpt b/tests/ext/telemetry/composer.phpt index 3edf95a73d9..ca9e8950bd9 100644 --- a/tests/ext/telemetry/composer.phpt +++ b/tests/ext/telemetry/composer.phpt @@ -10,6 +10,8 @@ require __DIR__ . '/../includes/clear_skipif_telemetry.inc' --ENV-- DD_TRACE_GENERATE_ROOT_SPAN=0 DD_INSTRUMENTATION_TELEMETRY_ENABLED=1 +DD_TRACE_AGENT_TIMEOUT=200 +DD_TRACE_RETRY_INTERVAL=1 --INI-- datadog.trace.agent_url="file://{PWD}/composer-telemetry.out" --FILE-- diff --git a/tests/ext/telemetry/config.phpt b/tests/ext/telemetry/config.phpt index fdebcc03fb4..f33ba3deab3 100644 --- a/tests/ext/telemetry/config.phpt +++ b/tests/ext/telemetry/config.phpt @@ -19,7 +19,8 @@ DD_TRACE_AUTOFINISH_SPANS=1 DD_INSTRUMENTATION_TELEMETRY_ENABLED=1 DD_AGENT_HOST= DD_AUTOLOAD_NO_COMPILE= -DD_TRACE_RETRY_INTERVAL= +DD_TRACE_AGENT_TIMEOUT=200 +DD_TRACE_RETRY_INTERVAL=1 DD_TRACE_GIT_METADATA_ENABLED=0 DD_TRACE_IGNORE_AGENT_SAMPLING_RATES=1 DD_EXPERIMENTAL_PROPAGATE_PROCESS_TAGS_ENABLED=0 @@ -49,7 +50,7 @@ for ($i = 0; $i < 300; ++$i) { if ($json["request_type"] == "app-client-configuration-change") { $cfg = $json["payload"]["configuration"]; print_r(array_values(array_filter($cfg, function ($c) { - return $c["origin"] == "env_var" && $c["name"] != "DD_TRACE_SOURCES_PATH" && $c["name"] != "DD_TRACE_SIDECAR_TRACE_SENDER"; + return $c["origin"] == "env_var" && $c["name"] != "DD_TRACE_SOURCES_PATH" && $c["name"] != "DD_TRACE_SIDECAR_TRACE_SENDER" && $c["name"] != "DD_TRACE_AGENT_TIMEOUT" && $c["name"] != "DD_TRACE_RETRY_INTERVAL"; }))); var_dump(count(array_filter($cfg, function ($c) { return $c["origin"] == "default"; diff --git a/tests/ext/telemetry/disabled.phpt b/tests/ext/telemetry/disabled.phpt index 606c412925d..bc4556365cb 100644 --- a/tests/ext/telemetry/disabled.phpt +++ b/tests/ext/telemetry/disabled.phpt @@ -8,6 +8,8 @@ if (PHP_OS === "WINNT" && PHP_VERSION_ID < 70400) die("skip: Windows on PHP 7.2 --ENV-- DD_TRACE_GENERATE_ROOT_SPAN=0 DD_INSTRUMENTATION_TELEMETRY_ENABLED=0 +DD_TRACE_AGENT_TIMEOUT=200 +DD_TRACE_RETRY_INTERVAL=1 --INI-- datadog.trace.agent_url="file://{PWD}/disabled-telemetry.out" --FILE-- diff --git a/tests/ext/telemetry/integration.phpt b/tests/ext/telemetry/integration.phpt index 8e74be22933..aca281f244a 100644 --- a/tests/ext/telemetry/integration.phpt +++ b/tests/ext/telemetry/integration.phpt @@ -11,6 +11,8 @@ require __DIR__ . '/../includes/clear_skipif_telemetry.inc' DD_TRACE_GENERATE_ROOT_SPAN=0 _DD_LOAD_TEST_INTEGRATIONS=1 DD_INSTRUMENTATION_TELEMETRY_ENABLED=1 +DD_TRACE_AGENT_TIMEOUT=200 +DD_TRACE_RETRY_INTERVAL=1 --INI-- datadog.trace.agent_url="file://{PWD}/integration-telemetry.out" --FILE-- diff --git a/tests/ext/telemetry/integration_filesystem_01.phpt b/tests/ext/telemetry/integration_filesystem_01.phpt index 1e27e3de854..e5ea6fc9703 100644 --- a/tests/ext/telemetry/integration_filesystem_01.phpt +++ b/tests/ext/telemetry/integration_filesystem_01.phpt @@ -12,6 +12,8 @@ DD_TRACE_GENERATE_ROOT_SPAN=0 _DD_LOAD_TEST_INTEGRATIONS=1 DD_INSTRUMENTATION_TELEMETRY_ENABLED=1 DD_APPSEC_RASP_ENABLED=0 +DD_TRACE_AGENT_TIMEOUT=200 +DD_TRACE_RETRY_INTERVAL=1 --INI-- datadog.trace.agent_url="file://{PWD}/integration-telemetry-01.out" --FILE-- diff --git a/tests/ext/telemetry/integration_filesystem_02.phpt b/tests/ext/telemetry/integration_filesystem_02.phpt index 1a3fa6930f6..ccdc38e8390 100644 --- a/tests/ext/telemetry/integration_filesystem_02.phpt +++ b/tests/ext/telemetry/integration_filesystem_02.phpt @@ -12,6 +12,8 @@ DD_TRACE_GENERATE_ROOT_SPAN=0 _DD_LOAD_TEST_INTEGRATIONS=1 DD_INSTRUMENTATION_TELEMETRY_ENABLED=1 DD_LOGS_INJECTION=false +DD_TRACE_AGENT_TIMEOUT=200 +DD_TRACE_RETRY_INTERVAL=1 --INI-- datadog.trace.agent_url="file://{PWD}/integration-telemetry-02.out" --FILE-- diff --git a/tests/ext/telemetry/integration_filesystem_03.phpt b/tests/ext/telemetry/integration_filesystem_03.phpt index c1abac3f0df..69592a68a76 100644 --- a/tests/ext/telemetry/integration_filesystem_03.phpt +++ b/tests/ext/telemetry/integration_filesystem_03.phpt @@ -11,6 +11,8 @@ require __DIR__ . '/../includes/clear_skipif_telemetry.inc' DD_TRACE_GENERATE_ROOT_SPAN=0 _DD_LOAD_TEST_INTEGRATIONS=1 DD_INSTRUMENTATION_TELEMETRY_ENABLED=1 +DD_TRACE_AGENT_TIMEOUT=200 +DD_TRACE_RETRY_INTERVAL=1 --INI-- datadog.trace.agent_url="file://{PWD}/integration-telemetry-03.out" --FILE-- diff --git a/tests/ext/telemetry/integration_filesystem_04.phpt b/tests/ext/telemetry/integration_filesystem_04.phpt index a8eb145e9ac..21778d9e6df 100644 --- a/tests/ext/telemetry/integration_filesystem_04.phpt +++ b/tests/ext/telemetry/integration_filesystem_04.phpt @@ -12,6 +12,8 @@ DD_TRACE_GENERATE_ROOT_SPAN=0 _DD_LOAD_TEST_INTEGRATIONS=1 DD_INSTRUMENTATION_TELEMETRY_ENABLED=1 DD_TRACE_FILESYSTEM_ENABLED=0 +DD_TRACE_AGENT_TIMEOUT=200 +DD_TRACE_RETRY_INTERVAL=1 --INI-- datadog.trace.agent_url="file://{PWD}/integration-telemetry-04.out" --FILE-- diff --git a/tests/ext/telemetry/integration_runtime_error.phpt b/tests/ext/telemetry/integration_runtime_error.phpt index 3a8a03aa35c..0d5e70c3c8a 100644 --- a/tests/ext/telemetry/integration_runtime_error.phpt +++ b/tests/ext/telemetry/integration_runtime_error.phpt @@ -12,6 +12,8 @@ DD_TRACE_GENERATE_ROOT_SPAN=0 DD_INSTRUMENTATION_TELEMETRY_ENABLED=1 DD_TELEMETRY_LOG_COLLECTION_ENABLED=1 DD_TRACE_LOG_LEVEL=warn +DD_TRACE_AGENT_TIMEOUT=200 +DD_TRACE_RETRY_INTERVAL=1 --INI-- datadog.trace.agent_url="file://{PWD}/integration-runtime-error-telemetry.out" --FILE-- diff --git a/tests/ext/telemetry/metrics_logs_created.phpt b/tests/ext/telemetry/metrics_logs_created.phpt index 16fb8bd8768..04585b82052 100644 --- a/tests/ext/telemetry/metrics_logs_created.phpt +++ b/tests/ext/telemetry/metrics_logs_created.phpt @@ -11,6 +11,8 @@ require __DIR__ . '/../includes/clear_skipif_telemetry.inc' DD_TRACE_GENERATE_ROOT_SPAN=0 DD_INSTRUMENTATION_TELEMETRY_ENABLED=1 DD_TRACE_LOG_LEVEL=warn +DD_TRACE_AGENT_TIMEOUT=200 +DD_TRACE_RETRY_INTERVAL=1 --INI-- datadog.trace.agent_url="file://{PWD}/metrics-logs-created-telemetry.out" --FILE-- diff --git a/tests/ext/telemetry/metrics_spans_created.phpt b/tests/ext/telemetry/metrics_spans_created.phpt index cf45f052ccc..2ddd79e6db4 100644 --- a/tests/ext/telemetry/metrics_spans_created.phpt +++ b/tests/ext/telemetry/metrics_spans_created.phpt @@ -11,6 +11,8 @@ require __DIR__ . '/../includes/clear_skipif_telemetry.inc' DD_TRACE_GENERATE_ROOT_SPAN=0 _DD_LOAD_TEST_INTEGRATIONS=1 DD_INSTRUMENTATION_TELEMETRY_ENABLED=1 +DD_TRACE_AGENT_TIMEOUT=200 +DD_TRACE_RETRY_INTERVAL=1 --INI-- datadog.trace.agent_url="file://{PWD}/metrics-spans_created-telemetry.out" zend.assertions=1 diff --git a/tests/ext/telemetry/simple.phpt b/tests/ext/telemetry/simple.phpt index 2279f460f56..cbd43881560 100644 --- a/tests/ext/telemetry/simple.phpt +++ b/tests/ext/telemetry/simple.phpt @@ -10,6 +10,8 @@ require __DIR__ . '/../includes/clear_skipif_telemetry.inc' --ENV-- DD_TRACE_GENERATE_ROOT_SPAN=0 DD_INSTRUMENTATION_TELEMETRY_ENABLED=1 +DD_TRACE_AGENT_TIMEOUT=200 +DD_TRACE_RETRY_INTERVAL=1 --INI-- datadog.trace.agent_url="file://{PWD}/simple-telemetry.out" --FILE-- diff --git a/tests/ext/telemetry/telemetry_process_tags.phpt b/tests/ext/telemetry/telemetry_process_tags.phpt index 503ccf10c14..b4c2a2cf661 100644 --- a/tests/ext/telemetry/telemetry_process_tags.phpt +++ b/tests/ext/telemetry/telemetry_process_tags.phpt @@ -12,6 +12,8 @@ DD_TRACE_GENERATE_ROOT_SPAN=0 _DD_LOAD_TEST_INTEGRATIONS=1 DD_INSTRUMENTATION_TELEMETRY_ENABLED=1 DD_EXPERIMENTAL_PROPAGATE_PROCESS_TAGS_ENABLED=1 +DD_TRACE_AGENT_TIMEOUT=200 +DD_TRACE_RETRY_INTERVAL=1 --INI-- datadog.trace.agent_url="file://{PWD}/process-tags-telemetry.out" --FILE-- diff --git a/tracer/coms.c b/tracer/coms.c index c0536926d4a..28aa5a375dc 100644 --- a/tracer/coms.c +++ b/tracer/coms.c @@ -806,8 +806,10 @@ void ddtrace_coms_curl_shutdown(void) { static long dd_max_long(long a, long b) { return a >= b ? a : b; } +// Shorter time for in-process timeout void ddtrace_curl_set_timeout(CURL *curl) { - long timeout = dd_max_long(get_global_DD_TRACE_BGS_TIMEOUT(), get_global_DD_TRACE_AGENT_TIMEOUT()); + long agent_timeout = zai_config_memoized_entries[DATADOG_CONFIG_DD_TRACE_AGENT_TIMEOUT].name_index == ZAI_CONFIG_ORIGIN_DEFAULT ? 500 : get_global_DD_TRACE_AGENT_TIMEOUT(); + long timeout = dd_max_long(get_global_DD_TRACE_BGS_TIMEOUT(), agent_timeout); curl_easy_setopt(curl, CURLOPT_TIMEOUT_MS, timeout); }