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
40 changes: 40 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions components-rs/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ typedef enum ddog_RemoteConfigProduct {
DDOG_REMOTE_CONFIG_PRODUCT_FFE_FLAGS,
DDOG_REMOTE_CONFIG_PRODUCT_LIVE_DEBUGGING,
DDOG_REMOTE_CONFIG_PRODUCT_LIVE_DEBUGGING_SYMBOL_DB,
DDOG_REMOTE_CONFIG_PRODUCT_DEBUG,
} ddog_RemoteConfigProduct;

typedef enum ddog_SpanProbeTarget {
Expand Down Expand Up @@ -1246,6 +1247,8 @@ typedef struct ddog_FfeExposure {
ddog_CharSlice subject_attributes_json;
ddog_CharSlice allocation_key;
ddog_CharSlice variant;
int32_t serial_id;
bool has_serial_id;
} ddog_FfeExposure;

typedef struct ddog_Slice_FfeExposure {
Expand Down
21 changes: 21 additions & 0 deletions components-rs/sidecar.h
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,27 @@ ddog_MaybeError ddog_sidecar_send_trace_v04_bytes(struct ddog_SidecarTransport *
ddog_CharSlice data,
const struct ddog_TracerHeaderTags *tracer_header_tags);

/**
* Sends a V1-encoded trace to the sidecar via shared memory. The sidecar decodes the V1
* `TracerPayload`, can inspect it, and re-encodes it as V1 msgpack on the way to the agent's
* `/v1.0/traces` endpoint.
*/
ddog_MaybeError ddog_sidecar_send_trace_v1_shm(struct ddog_SidecarTransport **transport,
const struct ddog_InstanceId *instance_id,
struct ddog_ShmHandle *shm_handle,
uintptr_t len,
const struct ddog_TracerHeaderTags *tracer_header_tags);

/**
* Sends a V1-encoded trace as bytes to the sidecar. The sidecar decodes the V1 `TracerPayload`,
* can inspect it, and re-encodes it as V1 msgpack on the way to the agent's `/v1.0/traces`
* endpoint.
*/
ddog_MaybeError ddog_sidecar_send_trace_v1_bytes(struct ddog_SidecarTransport **transport,
const struct ddog_InstanceId *instance_id,
ddog_CharSlice data,
const struct ddog_TracerHeaderTags *tracer_header_tags);

ddog_MaybeError ddog_sidecar_send_debugger_data(struct ddog_SidecarTransport **transport,
const struct ddog_InstanceId *instance_id,
ddog_QueueId queue_id,
Expand Down
2 changes: 1 addition & 1 deletion libdatadog
Submodule libdatadog updated 55 files
+1 −3 .github/CODEOWNERS
+27 −0 .github/workflows/cargo-deny-bans.yml
+2 −2 .github/workflows/pr-metadata-docs-and-deps.yml
+2 −2 .github/workflows/release-proposal-dispatch.yml
+2 −2 .github/workflows/release-proposal-test.yml
+13 −1 .github/workflows/test.yml
+88 −4 Cargo.lock
+1 −0 Cargo.toml
+6 −0 LICENSE-3rdparty.csv
+67 −0 bin_tests/src/modes/behavior.rs
+13 −25 bin_tests/src/modes/unix/test_002_sigchld.rs
+13 −23 bin_tests/src/modes/unix/test_003_sigchld_with_exec.rs
+13 −25 bin_tests/src/modes/unix/test_006_sigchld_sigstack.rs
+2 −2 builder/Cargo.toml
+104 −0 datadog-sidecar-ffi/src/lib.rs
+1 −5 datadog-sidecar/Cargo.toml
+43 −0 datadog-sidecar/src/service/blocking.rs
+1 −0 datadog-sidecar/src/service/ffe_exposures_flusher.rs
+43 −0 datadog-sidecar/src/service/sender.rs
+51 −0 datadog-sidecar/src/service/sidecar_interface.rs
+273 −12 datadog-sidecar/src/service/sidecar_server.rs
+28 −9 datadog-sidecar/src/tracer.rs
+22 −18 docs/RFCs/0015-crashtracker-all-thread-collection.md
+9 −2 libdd-crashtracker/src/receiver/entry_points.rs
+53 −11 libdd-crashtracker/src/receiver/mod.rs
+10 −5 libdd-crashtracker/src/receiver/receive_report.rs
+5 −0 libdd-data-pipeline/Cargo.toml
+5 −1 libdd-data-pipeline/src/trace_exporter/mod.rs
+8 −8 libdd-data-pipeline/src/trace_exporter/trace_serializer.rs
+146 −0 libdd-ffe/src/telemetry/exposures.rs
+6 −1 libdd-profiling/Cargo.toml
+9 −1 libdd-profiling/src/pprof/test_utils.rs
+97 −2 libdd-profiling/src/profiles/compressor.rs
+10 −3 libdd-remote-config/Cargo.toml
+56 −13 libdd-remote-config/src/fetch/agentless.rs
+15 −0 libdd-remote-config/src/fetch/agentless/integration_tests.rs
+1 −1 libdd-remote-config/src/fetch/fetcher.rs
+16 −0 libdd-remote-config/src/fetch/mod.rs
+4 −3 libdd-remote-config/src/fetch/multitarget.rs
+2 −2 libdd-remote-config/src/fetch/shared.rs
+4 −4 libdd-remote-config/src/fetch/single.rs
+21 −12 libdd-sampling/benches/sampling_bench.rs
+23 −14 libdd-sampling/src/v04_span.rs
+55 −39 libdd-trace-stats/src/span_concentrator/aggregation.rs
+28 −27 libdd-trace-stats/src/span_concentrator/tests.rs
+16 −12 libdd-trace-stats/src/stats_exporter.rs
+5 −1 libdd-trace-utils/Cargo.toml
+42 −2 libdd-trace-utils/benches/deserialization.rs
+20 −14 libdd-trace-utils/src/change_buffer/mod.rs
+8 −4 libdd-trace-utils/src/msgpack_encoder/v04/mod.rs
+91 −6 libdd-trace-utils/src/send_with_retry/compression.rs
+18 −8 libdd-trace-utils/src/span/mod.rs
+27 −18 libdd-trace-utils/src/span/v04/mod.rs
+20 −0 tests/wasm/Cargo.toml
+110 −0 tests/wasm/tests/compression.rs
10 changes: 9 additions & 1 deletion tracer/ffe.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ typedef struct {
zend_string *subject_attributes_json;
zend_string *allocation_key;
zend_string *variant;
int32_t serial_id;
bool has_serial_id;
} dd_ffe_exposure;

static void dd_ffe_release_metric(dd_ffe_metric *metric) {
Expand Down Expand Up @@ -168,7 +170,9 @@ void ddtrace_ffe_record_exposure(
zend_string *targeting_key,
zend_string *subject_attributes_json,
zend_string *allocation_key,
zend_string *variant
zend_string *variant,
int32_t serial_id,
bool has_serial_id
) {
if (ZSTR_LEN(flag_key) == 0 || ZSTR_LEN(variant) == 0) {
return;
Expand Down Expand Up @@ -200,6 +204,8 @@ void ddtrace_ffe_record_exposure(
exposure->subject_attributes_json = zend_string_copy(subject_attributes_json);
exposure->allocation_key = zend_string_copy(allocation_key);
exposure->variant = zend_string_copy(variant);
exposure->serial_id = serial_id;
exposure->has_serial_id = has_serial_id;
}

bool ddtrace_ffe_flush_exposures(void) {
Expand All @@ -224,6 +230,8 @@ bool ddtrace_ffe_flush_exposures(void) {
.subject_attributes_json = dd_zend_string_to_CharSlice(buffer[i].subject_attributes_json),
.allocation_key = dd_zend_string_to_CharSlice(buffer[i].allocation_key),
.variant = dd_zend_string_to_CharSlice(buffer[i].variant),
.serial_id = buffer[i].serial_id,
Comment thread
danyal002 marked this conversation as resolved.
.has_serial_id = buffer[i].has_serial_id,
};
}

Expand Down
3 changes: 2 additions & 1 deletion tracer/ffe.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@

#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <zend.h>

bool ddtrace_ffe_record_evaluation_metric(zend_string *flag_key, zend_string *variant, const char *reason, const char *error_type, zend_string *allocation_key);
bool ddtrace_ffe_flush_evaluation_metrics(void);

void ddtrace_ffe_record_exposure(zend_string *flag_key, zend_string *targeting_key, zend_string *subject_attributes_json, zend_string *allocation_key, zend_string *variant);
void ddtrace_ffe_record_exposure(zend_string *flag_key, zend_string *targeting_key, zend_string *subject_attributes_json, zend_string *allocation_key, zend_string *variant, int32_t serial_id, bool has_serial_id);
bool ddtrace_ffe_flush_exposures(void);

#endif // DDTRACE_FFE_H
4 changes: 3 additions & 1 deletion tracer/functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -1900,7 +1900,9 @@ PHP_FUNCTION(DDTrace_ffe_evaluate) {
targeting_key,
subject_attributes_json,
allocation_key,
variant
variant,
result.serial_id,
result.has_serial_id
);
zend_string_release(subject_attributes_json);
}
Expand Down
Loading