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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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= 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= 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))

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 }' )
Expand Down
19 changes: 19 additions & 0 deletions components-rs/crashtracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,25 @@ struct ddog_VoidResult ddog_crasht_report_unhandled_exception(ddog_CharSlice err
ddog_CharSlice error_message,
struct ddog_crasht_Handle_StackTrace *runtime_stack);

/**
* Register the expected PID of the socket-based crash receiver
*
* When `collect_all_threads` is enabled and the receiver is reached via a Unix
* socket, the crash handler will only grant ptrace permission if the socket
* peer's PID matches this registered value.
*
* Call this after establishing a trusted connection to the sidecar
*
* # Safety
* This function is safe to call from any thread at any time.
*/
void ddog_crasht_set_expected_receiver_pid(int32_t pid);

/**
* Returns the currently registered expected receiver PID, or 0 if unset.
*/
int32_t ddog_crasht_get_expected_receiver_pid(void);

/**
* Removes all existing additional tags
* Expected to be used after a fork, to reset the additional tags on the child
Expand Down
1 change: 1 addition & 0 deletions components-rs/sidecar.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ ddog_MaybeError ddog_sidecar_session_set_config(struct ddog_SidecarTransport **t
ddog_CharSlice language_version,
ddog_CharSlice tracer_version,
uint32_t flush_interval_milliseconds,
uint32_t retry_interval_milliseconds,
Comment thread
Leiyks marked this conversation as resolved.
uint32_t remote_config_poll_interval_millis,
uint32_t telemetry_heartbeat_interval_millis,
uint64_t telemetry_extended_heartbeat_interval_millis,
Expand Down
1 change: 1 addition & 0 deletions ext/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ enum datadog_sidecar_connection_mode {
CONFIG(BOOL, DD_INJECT_FORCE, "false", .ini_change = zai_config_system_ini_change) \
CONFIG(DOUBLE, DD_REMOTE_CONFIG_POLL_INTERVAL_SECONDS, "5.0", .ini_change = zai_config_system_ini_change) \
CONFIG(BOOL, DD_REMOTE_CONFIG_ENABLED, "true", .ini_change = zai_config_system_ini_change) \
CONFIG(INT, DD_TRACE_RETRY_INTERVAL, "100", .ini_change = zai_config_system_ini_change) \
CONFIG(BOOL, DD_EXPERIMENTAL_PROPAGATE_PROCESS_TAGS_ENABLED, "true")

#define DD_CONFIGURATIONS_ONLY
Expand Down
1 change: 1 addition & 0 deletions ext/sidecar.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ static void dd_sidecar_post_connect(ddog_SidecarTransport **transport, bool is_f
php_version_rt,
DDOG_CHARSLICE_C(PHP_DDTRACE_VERSION),
get_global_DD_TRACE_AGENT_FLUSH_INTERVAL(),
get_global_DD_TRACE_RETRY_INTERVAL(),
(int)(get_global_DD_REMOTE_CONFIG_POLL_INTERVAL_SECONDS() * 1000),
// for historical reasons in seconds
get_global_DD_TELEMETRY_HEARTBEAT_INTERVAL() * 1000,
Expand Down
7 changes: 7 additions & 0 deletions metadata/supported-configurations.json
Original file line number Diff line number Diff line change
Expand Up @@ -2168,6 +2168,13 @@
"default": "false"
}
],
"DD_TRACE_RETRY_INTERVAL": [
{
"implementation": "B",
"type": "int",
"default": "100"
}
],
"DD_TRACE_ROADRUNNER_ANALYTICS_ENABLED": [
{
"implementation": "A",
Expand Down
1 change: 1 addition & 0 deletions tests/ext/telemetry/config.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ DD_TRACE_AUTOFINISH_SPANS=1
DD_INSTRUMENTATION_TELEMETRY_ENABLED=1
DD_AGENT_HOST=
DD_AUTOLOAD_NO_COMPILE=
DD_TRACE_RETRY_INTERVAL=
DD_TRACE_GIT_METADATA_ENABLED=0
DD_TRACE_IGNORE_AGENT_SAMPLING_RATES=1
DD_EXPERIMENTAL_PROPAGATE_PROCESS_TAGS_ENABLED=0
Expand Down
Loading