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
1,218 changes: 1,097 additions & 121 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion 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},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")
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-ffe,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
3 changes: 2 additions & 1 deletion components-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ libdd-telemetry-ffi = { path = "../libdatadog/libdd-telemetry-ffi", default-feat
datadog-live-debugger = { path = "../libdatadog/datadog-live-debugger" }
datadog-live-debugger-ffi = { path = "../libdatadog/datadog-live-debugger-ffi", default-features = false }
datadog-ipc = { path = "../libdatadog/datadog-ipc" }
datadog-remote-config = { path = "../libdatadog/datadog-remote-config" }
datadog-remote-config = { path = "../libdatadog/datadog-remote-config", features = ["ffe"] }
datadog-sidecar = { path = "../libdatadog/datadog-sidecar" }
datadog-sidecar-ffi = { path = "../libdatadog/datadog-sidecar-ffi" }
libdd-tinybytes = { path = "../libdatadog/libdd-tinybytes" }
libdd-trace-utils = { path = "../libdatadog/libdd-trace-utils" }
libdd-crashtracker-ffi = { path = "../libdatadog/libdd-crashtracker-ffi", default-features = false, features = ["collector"] }
libdd-library-config-ffi = { path = "../libdatadog/libdd-library-config-ffi", default-features = false }
spawn_worker = { path = "../libdatadog/spawn_worker" }
datadog-ffe = { path = "../libdatadog/datadog-ffe" }
anyhow = { version = "1.0" }
const-str = "0.5.6"
itertools = "0.11.0"
Expand Down
34 changes: 33 additions & 1 deletion components-rs/ddtrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,46 @@ uint32_t ddog_get_logs_count(ddog_CharSlice level);

void ddog_init_remote_config(bool live_debugging_enabled,
bool appsec_activation,
bool appsec_config);
bool appsec_config,
bool ffe_enabled);

struct ddog_RemoteConfigState *ddog_init_remote_config_state(const struct ddog_Endpoint *endpoint);

const char *ddog_remote_config_get_path(const struct ddog_RemoteConfigState *remote_config);

bool ddog_process_remote_configs(struct ddog_RemoteConfigState *remote_config);

bool ddog_ffe_load_config(const char *json);

bool ddog_ffe_has_config(void);

bool ddog_ffe_config_changed(void);

struct FfeResult;

struct FfeAttribute {
const char *key;
int32_t value_type; /* 0=string, 1=number, 2=bool */
const char *string_value;
double number_value;
bool bool_value;
};

struct FfeResult *ddog_ffe_evaluate(
const char *flag_key,
int32_t expected_type,
const char *targeting_key,
const struct FfeAttribute *attributes,
size_t attributes_count);

const char *ddog_ffe_result_value(const struct FfeResult *r);
const char *ddog_ffe_result_variant(const struct FfeResult *r);
const char *ddog_ffe_result_allocation_key(const struct FfeResult *r);
int32_t ddog_ffe_result_reason(const struct FfeResult *r);
int32_t ddog_ffe_result_error_code(const struct FfeResult *r);
bool ddog_ffe_result_do_log(const struct FfeResult *r);
void ddog_ffe_free_result(struct FfeResult *r);

bool ddog_type_can_be_instrumented(const struct ddog_RemoteConfigState *remote_config,
ddog_CharSlice typename_);

Expand Down
Loading