Skip to content
Merged
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
359 changes: 259 additions & 100 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ RUN_TESTS_CMD := DD_SERVICE= DD_ENV= REPORT_EXIT_STATUS=1 TEST_PHP_SRCDIR=$(PROJ

C_FILES = $(shell find components components-rs ext src/dogstatsd 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 }' )
RUST_FILES = $(BUILD_DIR)/Cargo.toml $(BUILD_DIR)/Cargo.lock $(shell find components-rs -name '*.c' -o -name '*.rs' -o -name 'Cargo.toml' | awk '{ printf "$(BUILD_DIR)/%s\n", $$1 }' ) $(shell find libdatadog/{build-common,datadog-ipc,datadog-ipc-macros,datadog-live-debugger,datadog-live-debugger-ffi,datadog-remote-config,datadog-sidecar,datadog-sidecar-ffi,datadog-sidecar-macros,libdd-alloc,libdd-common,libdd-common-ffi,libdd-crashtracker,libdd-crashtracker-ffi,libdd-data-pipeline,libdd-ddsketch,libdd-dogstatsd-client,libdd-library-config,libdd-library-config-ffi,libdd-log,libdd-telemetry,libdd-telemetry-ffi,libdd-tinybytes,libdd-trace-*,spawn_worker,tools/{cc_utils,sidecar_mockgen},datadog-trace-*,Cargo.toml} \( -type l -o -type f \) \( -path "*/src*" -o -path "*/examples*" -o -path "*Cargo.toml" -o -path "*/build.rs" -o -path "*/tests/dataservice.rs" -o -path "*/tests/service_functional.rs" \) -not -path "*/datadog-ipc/build.rs" -not -path "*/datadog-sidecar-ffi/build.rs")
RUST_FILES = $(BUILD_DIR)/Cargo.toml $(BUILD_DIR)/Cargo.lock $(shell find components-rs -name '*.c' -o -name '*.rs' -o -name 'Cargo.toml' | awk '{ printf "$(BUILD_DIR)/%s\n", $$1 }' ) $(shell find libdatadog/{build-common,datadog-ipc,datadog-ipc-macros,datadog-live-debugger,datadog-live-debugger-ffi,datadog-remote-config,datadog-sidecar,datadog-sidecar-ffi,datadog-sidecar-macros,libdd-alloc,libdd-common,libdd-common-ffi,libdd-crashtracker,libdd-crashtracker-ffi,libdd-data-pipeline,libdd-ddsketch,libdd-dogstatsd-client,libdd-library-config,libdd-library-config-ffi,libdd-log,libdd-telemetry,libdd-telemetry-ffi,libdd-tinybytes,libdd-trace-*,spawn_worker,tools/{cc_utils,sidecar_mockgen},libdd-trace-*,Cargo.toml} \( -type l -o -type f \) \( -path "*/src*" -o -path "*/examples*" -o -path "*Cargo.toml" -o -path "*/build.rs" -o -path "*/tests/dataservice.rs" -o -path "*/tests/service_functional.rs" \) -not -path "*/datadog-ipc/build.rs" -not -path "*/datadog-sidecar-ffi/build.rs")
ALL_OBJECT_FILES = $(C_FILES) $(RUST_FILES) $(BUILD_DIR)/Makefile
TEST_OPCACHE_FILES = $(shell find tests/opcache -name '*.php*' -o -name '.gitkeep' | awk '{ printf "$(BUILD_DIR)/%s\n", $$1 }' )
TEST_STUB_FILES = $(shell find tests/ext -type d -name 'stubs' -exec find '{}' -type f \; | awk '{ printf "$(BUILD_DIR)/%s\n", $$1 }' )
Expand Down Expand Up @@ -500,9 +500,7 @@ $(PACKAGES_BUILD_DIR)/datadog-setup.php: $(PACKAGES_BUILD_DIR)
$(PACKAGES_BUILD_DIR)

build_pecl_package:
BUILD_DIR='$(BUILD_DIR)/'; \
FILES="$(C_FILES) $(RUST_FILES) $(TEST_FILES) $(TEST_STUB_FILES) $(M4_FILES) Cargo.lock"; \
tooling/bin/pecl-build $${FILES//$${BUILD_DIR}/}
echo $(subst $(BUILD_DIR)/,,$(C_FILES) $(RUST_FILES) $(TEST_FILES) $(TEST_STUB_FILES) $(M4_FILES) Cargo.lock) | tooling/bin/pecl-build

dbgsym.tar.gz: $(PACKAGES_BUILD_DIR)
$(if $(DDTRACE_MAKE_PACKAGES_ASAN), , tar -zcf $(PACKAGES_BUILD_DIR)/dd-library-php-$(VERSION)_windows_debugsymbols.tar.gz ./extensions_x86_64_debugsymbols --owner=0 --group=0)
Expand Down
4 changes: 1 addition & 3 deletions compile_rust.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
cd components-rs

RUSTFLAGS="${RUSTFLAGS:-} --cfg tokio_unstable"
if if test -z "${host_os:-}"; then case "${host_os}" in linux*) true;; *) false; esac else test "$(uname -s)" = "Linux"; fi then
RUSTFLAGS="$RUSTFLAGS --cfg tokio_taskdump"
fi

if test -n "$SHARED"; then
RUSTFLAGS="$RUSTFLAGS --cfg php_shared_build"
fi
Expand Down
1 change: 1 addition & 0 deletions components-rs/telemetry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ pub unsafe extern "C" fn ddog_sidecar_telemetry_enqueueConfig_buffer(
value: config_value.to_utf8_lossy().into_owned(),
origin,
config_id,
seq_id: None,
});
buffer.buffer.push(SidecarAction::Telemetry(action));
}
Expand Down
2 changes: 1 addition & 1 deletion libdatadog
Submodule libdatadog updated 257 files
6 changes: 3 additions & 3 deletions loader/tests/functional/test_configuration_telemetry.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@
usleep(10000);

$content = file_get_contents($telemetryLogPath);
assertContains($content, '{"name":"instrumentation_source","value":"ssi","origin":"default","config_id":null}');
assertContains($content, '{"name":"ssi_injection_enabled","value":"tracer","origin":"env_var","config_id":null}');
assertContains($content, '{"name":"ssi_forced_injection_enabled","value":"True","origin":"env_var","config_id":null}');
assertContains($content, '{"name":"instrumentation_source","value":"ssi","origin":"default","config_id":null,"seq_id":null}');
assertContains($content, '{"name":"ssi_injection_enabled","value":"tracer","origin":"env_var","config_id":null,"seq_id":null}');
assertContains($content, '{"name":"ssi_forced_injection_enabled","value":"True","origin":"env_var","config_id":null,"seq_id":null}');
6 changes: 3 additions & 3 deletions profiling/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ cfg-if = { version = "1.0" }
cpu-time = { version = "1.0" }
chrono = { version = "0.4" }
crossbeam-channel = { version = "0.5", default-features = false, features = ["std"] }
libdd-alloc = { git = "https://github.com/DataDog/libdatadog", tag = "v24.0.2" }
libdd-profiling = { git = "https://github.com/DataDog/libdatadog", tag = "v24.0.2" }
libdd-common = { git = "https://github.com/DataDog/libdatadog", tag = "v24.0.2" }
libdd-alloc = { git = "https://github.com/DataDog/libdatadog", tag = "v25.0.0" }
libdd-profiling = { git = "https://github.com/DataDog/libdatadog", tag = "v25.0.0" }
libdd-common = { git = "https://github.com/DataDog/libdatadog", tag = "v25.0.0" }
libdd-library-config-ffi = { path = "../libdatadog/libdd-library-config-ffi" }
env_logger = { version = "0.11", default-features = false }
lazy_static = { version = "1.4" }
Expand Down
1 change: 1 addition & 0 deletions profiling/src/profiling/uploader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ impl Uploader {
&[],
&[],
None,
None,
#[cfg(feature = "debug_stats")]
Self::create_internal_metadata(),
#[cfg(not(feature = "debug_stats"))]
Expand Down
2 changes: 1 addition & 1 deletion src/DDTrace/OpenTelemetry/Span.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ public function getKind(): int
/**
* @inheritDoc
*/
public function getAttribute(string $key)
public function getAttribute(string $key): mixed
{
return $this->span->meta[$key] ?? ($this->span->metrics[$key] ?? null);
}
Expand Down
4 changes: 3 additions & 1 deletion tests/ext/appsec/sca_flag_is_sent_01.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ datadog.trace.agent_url="file://{PWD}/sca_flag_is_sent_01-telemetry.out"
--FILE_EXTERNAL--
sca_test.inc
--EXPECT--
array(4) {
array(5) {
["name"]=>
string(18) "appsec.sca_enabled"
["value"]=>
Expand All @@ -26,6 +26,8 @@ array(4) {
string(7) "default"
["config_id"]=>
NULL
["seq_id"]=>
NULL
}
string(4) "Sent"
--CLEAN--
Expand Down
4 changes: 3 additions & 1 deletion tests/ext/appsec/sca_flag_is_sent_02.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ datadog.trace.agent_url="file://{PWD}/sca_flag_is_sent_02-telemetry.out"
--FILE_EXTERNAL--
sca_test.inc
--EXPECT--
array(4) {
array(5) {
["name"]=>
string(18) "appsec.sca_enabled"
["value"]=>
Expand All @@ -27,6 +27,8 @@ array(4) {
string(7) "env_var"
["config_id"]=>
NULL
["seq_id"]=>
NULL
}
string(4) "Sent"
--CLEAN--
Expand Down
4 changes: 3 additions & 1 deletion tests/ext/appsec/sca_flag_is_sent_03.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ datadog.trace.agent_url="file://{PWD}/sca_flag_is_sent_03-telemetry.out"
--FILE_EXTERNAL--
sca_test.inc
--EXPECT--
array(4) {
array(5) {
["name"]=>
string(18) "appsec.sca_enabled"
["value"]=>
Expand All @@ -27,6 +27,8 @@ array(4) {
string(7) "env_var"
["config_id"]=>
NULL
["seq_id"]=>
NULL
}
string(4) "Sent"
--CLEAN--
Expand Down
4 changes: 3 additions & 1 deletion tests/ext/appsec/sca_flag_is_sent_04.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ datadog.appsec.sca_enabled=1
--FILE_EXTERNAL--
sca_test.inc
--EXPECT--
array(4) {
array(5) {
["name"]=>
string(18) "appsec.sca_enabled"
["value"]=>
Expand All @@ -27,6 +27,8 @@ array(4) {
string(7) "env_var"
["config_id"]=>
NULL
["seq_id"]=>
NULL
}
string(4) "Sent"
--CLEAN--
Expand Down
4 changes: 3 additions & 1 deletion tests/ext/appsec/sca_flag_is_sent_05.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ datadog.appsec.sca_enabled=0
--FILE_EXTERNAL--
sca_test.inc
--EXPECT--
array(4) {
array(5) {
["name"]=>
string(18) "appsec.sca_enabled"
["value"]=>
Expand All @@ -27,6 +27,8 @@ array(4) {
string(7) "env_var"
["config_id"]=>
NULL
["seq_id"]=>
NULL
}
string(4) "Sent"
--CLEAN--
Expand Down
20 changes: 15 additions & 5 deletions tests/ext/library_config/fleet_config.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ DD_DYNAMIC_INSTRUMENTATION_ENABLED: true
------ Telemetry ------
array(5) {
[0]=>
array(4) {
array(5) {
["name"]=>
string(3) "env"
["value"]=>
Expand All @@ -85,9 +85,11 @@ array(5) {
string(19) "fleet_stable_config"
["config_id"]=>
string(15) "42_fleet_config"
["seq_id"]=>
NULL
}
[1]=>
array(4) {
array(5) {
["name"]=>
string(7) "service"
["value"]=>
Expand All @@ -96,9 +98,11 @@ array(5) {
string(19) "fleet_stable_config"
["config_id"]=>
string(15) "42_fleet_config"
["seq_id"]=>
NULL
}
[2]=>
array(4) {
array(5) {
["name"]=>
string(24) "trace.generate_root_span"
["value"]=>
Expand All @@ -107,9 +111,11 @@ array(5) {
string(7) "default"
["config_id"]=>
NULL
["seq_id"]=>
NULL
}
[3]=>
array(4) {
array(5) {
["name"]=>
string(17) "trace.spans_limit"
["value"]=>
Expand All @@ -118,9 +124,11 @@ array(5) {
string(7) "env_var"
["config_id"]=>
NULL
["seq_id"]=>
NULL
}
[4]=>
array(4) {
array(5) {
["name"]=>
string(31) "dynamic_instrumentation.enabled"
["value"]=>
Expand All @@ -129,6 +137,8 @@ array(5) {
string(19) "fleet_stable_config"
["config_id"]=>
string(15) "42_fleet_config"
["seq_id"]=>
NULL
}
}
--CLEAN--
Expand Down
20 changes: 15 additions & 5 deletions tests/ext/library_config/local_config.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ DD_DYNAMIC_INSTRUMENTATION_ENABLED: true
------ Telemetry ------
array(5) {
[0]=>
array(4) {
array(5) {
["name"]=>
string(3) "env"
["value"]=>
Expand All @@ -85,9 +85,11 @@ array(5) {
string(19) "local_stable_config"
["config_id"]=>
string(15) "42_local_config"
["seq_id"]=>
NULL
}
[1]=>
array(4) {
array(5) {
["name"]=>
string(7) "service"
["value"]=>
Expand All @@ -96,9 +98,11 @@ array(5) {
string(19) "local_stable_config"
["config_id"]=>
string(15) "42_local_config"
["seq_id"]=>
NULL
}
[2]=>
array(4) {
array(5) {
["name"]=>
string(24) "trace.generate_root_span"
["value"]=>
Expand All @@ -107,9 +111,11 @@ array(5) {
string(7) "default"
["config_id"]=>
NULL
["seq_id"]=>
NULL
}
[3]=>
array(4) {
array(5) {
["name"]=>
string(17) "trace.spans_limit"
["value"]=>
Expand All @@ -118,9 +124,11 @@ array(5) {
string(7) "env_var"
["config_id"]=>
NULL
["seq_id"]=>
NULL
}
[4]=>
array(4) {
array(5) {
["name"]=>
string(31) "dynamic_instrumentation.enabled"
["value"]=>
Expand All @@ -129,6 +137,8 @@ array(5) {
string(19) "local_stable_config"
["config_id"]=>
string(15) "42_local_config"
["seq_id"]=>
NULL
}
}
--CLEAN--
Expand Down
6 changes: 6 additions & 0 deletions tests/ext/telemetry/config.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ Array
[value] => file://%s/config-telemetry.out
[origin] => env_var
[config_id] =>
[seq_id] =>
)

[1] => Array
Expand All @@ -82,6 +83,7 @@ Array
[value] => 1
[origin] => env_var
[config_id] =>
[seq_id] =>
)

[2] => Array
Expand All @@ -90,6 +92,7 @@ Array
[value] => 1
[origin] => env_var
[config_id] =>
[seq_id] =>
)

[3] => Array
Expand All @@ -98,6 +101,7 @@ Array
[value] => 0
[origin] => env_var
[config_id] =>
[seq_id] =>
)

[4] => Array
Expand All @@ -106,6 +110,7 @@ Array
[value] => 0
[origin] => env_var
[config_id] =>
[seq_id] =>
)

[5] => Array
Expand All @@ -114,6 +119,7 @@ Array
[value] => False
[origin] => env_var
[config_id] =>
[seq_id] =>
)

)
Expand Down
2 changes: 1 addition & 1 deletion tooling/bin/pecl-build
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ configuration_placeholder='
'

codefiles=""
for file in "$@"; do
for file in $(cat); do # cat to read from STDIN
codefiles="${codefiles}"$'\n <file name="'"${file}"'" role="'"$([[ $file == tests/* ]] && echo test || echo src)"'" '"$([[ $file == */configuration.h ]] && echo ">$configuration_placeholder" || echo "/>")"
done

Expand Down
Loading