Skip to content
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ DD_TRACE_BGS_ENABLED=1
DD_AGENT_HOST=request-replayer
DD_TRACE_AGENT_PORT=80
DD_TRACE_AGENT_FLUSH_AFTER_N_REQUESTS=1
DD_TRACE_AGENT_FLUSH_INTERVAL=333
DD_TRACE_AGENT_FLUSH_INTERVAL=666
DD_TRACE_GENERATE_ROOT_SPAN=0
DD_INSTRUMENTATION_TELEMETRY_ENABLED=0
--INI--
Expand Down
1 change: 1 addition & 0 deletions tests/ext/request-replayer/client_side_stats.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ DD_TRACE_GENERATE_ROOT_SPAN=0
DD_INSTRUMENTATION_TELEMETRY_ENABLED=0
DD_TRACE_SIDECAR_TRACE_SENDER=1
DD_TRACE_STATS_COMPUTATION_ENABLED=1
DD_TRACE_LOG_LEVEL=off
--INI--
datadog.env=test-env
datadog.version=1.2.3-basic
Expand Down
10 changes: 9 additions & 1 deletion tests/ext/shm_data_internal_fns.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ DD_REMOTE_CONFIG_POLL_INTERVAL_SECONDS=0.1
DD_TRACE_SIDECAR_TRACE_SENDER=1
DD_DYNAMIC_INSTRUMENTATION_ENABLED=1
DD_TRACE_IGNORE_AGENT_SAMPLING_RATES=0
DD_TRACE_LOG_LEVEL=off
--INI--
datadog.service=shm_data_test
datadog.env=test
Expand Down Expand Up @@ -64,9 +65,16 @@ $rr->setResponse(['rate_by_service' => [
dd_trace_internal_fn('synchronous_flush'); // ensure sidecar sends immediately
$rr->waitForDataAndReplay();

for ($i = 0; $i < 50; $i++) {
// Under concurrent run-tests load the best-effort synchronous_flush above can
// time out, delaying delivery of the trace that makes the replayer return the
// sampling rates. Re-trigger the flush periodically and poll generously so the
// agent sampling config eventually propagates into SHM.
for ($i = 0; $i < 100; $i++) {
$sampling = dd_trace_internal_fn('get_agent_sampling_config');
if (!empty($sampling)) { break; }
if ($i % 10 === 9) {
dd_trace_internal_fn('synchronous_flush');
}
usleep(100000);
}
var_dump(is_array($sampling));
Expand Down
Loading