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
32 changes: 26 additions & 6 deletions Cargo.lock

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

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ hex = { version = "0.4", default-features = false }
http = { version = "1.1", default-features = false }
http-body = { version = "1", default-features = false }
http-body-util = { version = "0.1", default-features = false }
httpdate = { version = "1.0", default-features = false }
# allow(workspace-deps-features): httpmock 0.8.0-alpha.1 does not compile
# without the `cookies` feature: its own `readers.rs` calls `req.cookies()`
# unconditionally while that method is gated behind `cookies`. Keep it as a
Expand Down Expand Up @@ -286,7 +287,7 @@ rmpv = { version = "1.3.0", default-features = false }
rustc-hash = { version = "2.1.1", default-features = false }
rustls = { version = "0.23", default-features = false }
rustls-platform-verifier = { version = "0.6", default-features = false }
rustls-webpki = { version = ">=0.103.13", default-features = false }
rustls-webpki = { version = "0.103.16", default-features = false }
schemars = { version = "0.8.21", default-features = false }
semver = { version = "1.0", default-features = false }
serde = { version = "1.0", default-features = false }
Expand Down Expand Up @@ -343,6 +344,8 @@ walkdir = { version = "2.4", default-features = false }
wasm-bindgen-futures = { version = "0.4", default-features = false }
wasm-bindgen-test = { version = "=0.3.50", default-features = false }
web-time = { version = "1", default-features = false }
webpki-root-certs = { version = "1.0.10", default-features = false }
webpki-roots = { version = "1.0.10", default-features = false }
windows = { version = "0.59.0", default-features = false }
windows-sys = { version = "0.52", default-features = false }
winver = { version = "1.0.0", default-features = false }
Expand Down
28 changes: 0 additions & 28 deletions components-rs/crashtracker.h
Original file line number Diff line number Diff line change
Expand Up @@ -407,34 +407,6 @@ bool ddog_crasht_init_windows(ddog_CharSlice module,
struct ddog_crasht_Metadata metadata);
#endif

#if (defined(_CRASHTRACKING_COLLECTOR) && defined(_WIN32))
HRESULT OutOfProcessExceptionEventSignatureCallback(const void *_context,
const WER_RUNTIME_EXCEPTION_INFORMATION *_exception_information,
int32_t _index,
uint16_t *_name,
uint32_t *_name_size,
uint16_t *_value,
uint32_t *_value_size);
#endif

#if (defined(_CRASHTRACKING_COLLECTOR) && defined(_WIN32))
HRESULT OutOfProcessExceptionEventDebuggerLaunchCallback(const void *_context,
const WER_RUNTIME_EXCEPTION_INFORMATION *_exception_information,
BOOL *_is_custom_debugger,
uint16_t *_debugger_launch,
uint32_t *_debugger_launch_size,
BOOL *_is_debugger_auto_launch);
#endif

#if (defined(_CRASHTRACKING_COLLECTOR) && defined(_WIN32))
HRESULT OutOfProcessExceptionEventCallback(const void *context,
const WER_RUNTIME_EXCEPTION_INFORMATION *exception_information,
BOOL *_ownership_claimed,
uint16_t *_event_name,
uint32_t *_size,
uint32_t *_signature_count);
#endif

/**
* # Safety
* The `crash_info` can be null, but if non-null it must point to a Builder made by this module,
Expand Down
2 changes: 1 addition & 1 deletion libdatadog
Submodule libdatadog updated 95 files
+61 −0 .claude/skills/add-remote-config-capability/SKILL.md
+110 −104 .github/CODEOWNERS
+2 −2 .github/actions/Cargo.lock
+57 −9 .github/actions/setup-sccache/action.yml
+1 −0 .github/labeler.yml
+1 −3 .github/workflows/cargo-deny-bans.yml
+71 −4 .github/workflows/coverage.yml
+55 −20 .github/workflows/lint.yml
+2 −2 .github/workflows/nix.yml
+6 −16 .github/workflows/pr-metadata-docs-and-deps.yml
+9 −8 .github/workflows/pr-title-semver-check.yml
+4 −0 .github/workflows/release-proposal-dispatch.yml
+30 −3 .github/workflows/test.yml
+5 −9 .github/workflows/verify-proto-files.yml
+112 −75 Cargo.lock
+5 −1 Cargo.toml
+7 −6 benchmark/select_bench_packages.sh
+2 −1 datadog-sidecar/src/auth.rs
+5 −1 datadog-sidecar/src/service/exception_hash_rate_limiter.rs
+39 −6 datadog-sidecar/src/service/flagevaluation_privacy_tests.rs
+6 −0 datadog-sidecar/src/service/mod.rs
+295 −2 datadog-sidecar/src/service/sidecar_server.rs
+3 −2 datadog-sidecar/src/setup/unix.rs
+2 −2 libdd-agent-client/src/builder.rs
+45 −10 libdd-common/Cargo.toml
+127 −0 libdd-common/src/connector/proxy.rs
+1 −1 libdd-common/src/tag.rs
+0 −3 libdd-crashtracker-ffi/Cargo.toml
+17 −9 libdd-crashtracker-ffi/src/collector_windows/api.rs
+141 −32 libdd-crashtracker/src/collector_windows/api.rs
+76 −1 libdd-data-pipeline-core/src/agentless/exporter.rs
+4 −1 libdd-data-pipeline-core/src/agentless/mod.rs
+2 −1 libdd-data-pipeline-core/src/lib.rs
+33 −0 libdd-data-pipeline/src/agentless/exporter.rs
+0 −1 libdd-data-pipeline/src/trace_exporter/log_writer.rs
+651 −25 libdd-data-pipeline/src/trace_exporter/mod.rs
+81 −15 libdd-data-pipeline/src/trace_exporter/stats.rs
+6 −4 libdd-data-pipeline/src/trace_exporter/trace_serializer.rs
+2 −1 libdd-dogstatsd-client/src/client/mod.rs
+21 −1 libdd-ffe/Cargo.toml
+44 −0 libdd-ffe/README.md
+199 −0 libdd-ffe/src/cdn.rs
+476 −0 libdd-ffe/src/cdn/endpoint.rs
+930 −0 libdd-ffe/src/cdn/poller.rs
+530 −0 libdd-ffe/src/cdn/transport.rs
+3 −0 libdd-ffe/src/lib.rs
+1 −1 libdd-gotter/src/elf.rs
+5 −3 libdd-ipc/src/platform/windows/sockets.rs
+55 −14 libdd-ipc/src/rate_limiter.rs
+1 −1 libdd-ipc/src/shm_stats.rs
+11 −2 libdd-otel-thread-ctx/src/lib.rs
+3 −3 libdd-otel-thread-ctx/src/linux.rs
+4 −2 libdd-profiling-heap-sampler/src/usdt_check.rs
+2 −0 libdd-profiling-protobuf/src/string.rs
+13 −10 libdd-profiling/src/internal/profile/mod.rs
+1 −1 libdd-shared-runtime/src/lib.rs
+5 −5 libdd-telemetry/src/worker/metric_ring.rs
+3 −0 libdd-tinybytes/Cargo.toml
+7 −0 libdd-tinybytes/src/bytes_string.rs
+16 −0 libdd-trace-model/Cargo.toml
+20 −0 libdd-trace-model/README.md
+363 −0 libdd-trace-model/src/lib.rs
+1 −0 libdd-trace-obfuscation/Cargo.toml
+438 −3 libdd-trace-obfuscation/src/obfuscate.rs
+115 −1 libdd-trace-obfuscation/src/replacer.rs
+4 −0 libdd-trace-protobuf/src/lib.rs
+2 −1 libdd-trace-stats/src/stats_exporter.rs
+6 −1 libdd-trace-utils/Cargo.toml
+4 −1 libdd-trace-utils/benches/main.rs
+171 −0 libdd-trace-utils/benches/span_pool_v1.rs
+25 −9 libdd-trace-utils/benches/vec_map_bench.rs
+7 −7 libdd-trace-utils/src/agentless_encoder/mod.rs
+4 −4 libdd-trace-utils/src/agentless_encoder/tests_v1.rs
+5 −5 libdd-trace-utils/src/json_log_encoder/mod.rs
+7 −7 libdd-trace-utils/src/json_log_encoder/span_v1.rs
+1 −0 libdd-trace-utils/src/lib.rs
+3 −3 libdd-trace-utils/src/msgpack_decoder/v1/mod.rs
+4 −4 libdd-trace-utils/src/msgpack_decoder/v1/span.rs
+13 −13 libdd-trace-utils/src/msgpack_encoder/v04/span_v1.rs
+4 −4 libdd-trace-utils/src/msgpack_encoder/v1/mod.rs
+2 −2 libdd-trace-utils/src/msgpack_encoder/v1/span_v1.rs
+2 −1 libdd-trace-utils/src/otlp_encoder/mapper.rs
+40 −4 libdd-trace-utils/src/otlp_encoder/mapper_v1.rs
+24 −6 libdd-trace-utils/src/span/mod.rs
+1 −1 libdd-trace-utils/src/span/span_pool.rs
+8 −7 libdd-trace-utils/src/span/trace_utils_v1.rs
+89 −31 libdd-trace-utils/src/span/v1/mod.rs
+473 −0 libdd-trace-utils/src/span/v1/span_pool.rs
+263 −27 libdd-trace-utils/src/span/vec_map.rs
+367 −0 libdd-trace-utils/src/stack_alloc.rs
+18 −11 libdd-trace-utils/src/trace_filter.rs
+1 −1 libdd-trace-utils/src/tracer_payload.rs
+7 −7 libdd-trace-utils/tests/test_send_data.rs
+9 −0 scripts/check_crypto_providers.sh
+98 −0 scripts/split_lcov.sh
15 changes: 10 additions & 5 deletions tests/Common/FeatureFlags/flag_evaluation_wire.inc
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ try {
$rows = array();
$exposureCount = 0;
$identity = true;
$evaluationIdentityAbsent = true;
$evaluationIdentity = true;
$protectedBytesAbsent = true;
foreach ($captures as $capture) {
list($request, $headers, $payload) = $capture;
Expand All @@ -95,10 +95,15 @@ try {
if (strpos($capture[3], 'ffe-error-pii-canary@example.test') !== false) {
throw new RuntimeException('raw error text reached the payload');
}
// Application attribution is deferred to FFL-3438/FFL-3439.
$evaluationIdentityAbsent = $evaluationIdentityAbsent && $payload['context'] === array();
$context = $payload['context'];
ksort($context);
$evaluationIdentity = $evaluationIdentity
&& $context === array('env' => 'test', 'service' => 'php-ffe-wire', 'version' => 'wire-version');
foreach ($payload['flagEvaluations'] as $row) {
$evaluationIdentityAbsent = $evaluationIdentityAbsent && !isset($row['context']['dd']);
// Environment and application version belong only on the batch.
$evaluationIdentity = $evaluationIdentity
&& isset($row['context']['dd'])
&& $row['context']['dd'] === array('service' => 'php-ffe-wire');
$key = $row['flag']['key'];
if (isset($rows[$key])) {
$rows[$key]['evaluation_count'] += $row['evaluation_count'];
Expand All @@ -120,7 +125,7 @@ try {
}
echo 'exposure_service=php-ffe-wire', "\n";
echo 'identity='; var_dump($identity);
echo 'evaluation_application_identity_absent='; var_dump($evaluationIdentityAbsent);
echo 'evaluation_application_identity='; var_dump($evaluationIdentity);
echo 'exposures='; var_dump($exposureCount);
echo 'consented_count='; var_dump($rows['consented']['evaluation_count']);
echo 'consented_subject='; var_dump($rows['consented']['targeting_key']);
Expand Down
2 changes: 1 addition & 1 deletion tests/OpenFeature/flag_evaluation_openfeature_wire.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ require __DIR__ . '/../Common/FeatureFlags/flag_evaluation_wire.inc';
--EXPECT--
exposure_service=php-ffe-wire
identity=bool(true)
evaluation_application_identity_absent=bool(true)
evaluation_application_identity=bool(true)
exposures=int(2)
consented_count=int(2)
consented_subject=string(7) "subject"
Expand Down
2 changes: 1 addition & 1 deletion tests/api/Unit/FeatureFlags/flag_evaluation_wire.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ require __DIR__ . '/../../../Common/FeatureFlags/flag_evaluation_wire.inc';
--EXPECT--
exposure_service=php-ffe-wire
identity=bool(true)
evaluation_application_identity_absent=bool(true)
evaluation_application_identity=bool(true)
exposures=int(2)
consented_count=int(2)
consented_subject=string(7) "subject"
Expand Down
38 changes: 29 additions & 9 deletions tests/ext/ffe/flag_evaluation_identity.phpt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--TEST--
FFE evaluations remain deliverable without application identity pending sidecar attribution
FFE evaluations retain resolved application identity across changes before flush
--SKIPIF--
<?php
if (PHP_VERSION_ID < 70200) die('skip: TEST_PHP_EXTRA_ARGS requires PHP 7.2+');
Expand Down Expand Up @@ -45,11 +45,20 @@ try {
}
if (strpos($request, '/flagevaluation ') !== false) {
$payload = json_decode($body, true);
// FFL-3438/FFL-3439 will replace these temporary expectations
// with identity supplied by the sidecar before aggregation.
$context = $payload['context'];
$key = implode('|', array(
isset($context['service']) ? $context['service'] : '',
isset($context['env']) ? $context['env'] : '',
isset($context['version']) ? $context['version'] : '',
));
foreach ($payload['flagEvaluations'] as $row) {
$contexts[$row['flag']['key']] = $payload['context'] === array()
&& !isset($row['context']['dd']) && $row['evaluation_count'] === 1;
if (isset($contexts[$key])) throw new RuntimeException('duplicate application row');
$contexts[$key] = $row['flag']['key'] === 'same-flag'
&& isset($row['context']['dd'])
&& $row['context']['dd'] === array('service' => $context['service'])
&& $row['evaluation_count'] === 1
&& $row['first_evaluation'] === 1700000000123
&& $row['last_evaluation'] === 1700000000123;
}
}
fwrite($connection, "HTTP/1.1 200 OK\r\nContent-Length: 2\r\nConnection: close\r\n\r\n{}");
Expand All @@ -59,9 +68,16 @@ try {
if (!$status['running']) { $exitCode = $status['exitcode']; break; }
}
if ($exitCode !== 0) throw new RuntimeException('child failed: ' . ffeTestProcessRead($pipes[2]));
foreach (array('default', 'configured') as $flag) {
echo $flag, '='; var_dump($contexts[$flag]);
foreach (array(
'flag_evaluation_identity_app.php|none|',
'app-a|test|v1',
'app-b|test|v1',
'app-b|production|v1',
'app-b|production|v2',
) as $key) {
echo $key, '='; var_dump(isset($contexts[$key]) && $contexts[$key]);
}
echo 'application_groups='; var_dump(count($contexts));
} finally {
if ($exitCode === null) proc_terminate($process);
foreach ($pipes as $pipe) fclose($pipe);
Expand All @@ -70,5 +86,9 @@ try {
}
?>
--EXPECT--
default=bool(true)
configured=bool(true)
flag_evaluation_identity_app.php|none|=bool(true)
app-a|test|v1=bool(true)
app-b|test|v1=bool(true)
app-b|production|v1=bool(true)
app-b|production|v2=bool(true)
application_groups=int(5)
18 changes: 12 additions & 6 deletions tests/ext/ffe/stubs/flag_evaluation_identity_app.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
<?php
foreach (array('default', 'configured') as $flag) {
if ($flag === 'configured') {
ini_set('datadog.service', 'changed-service');
ini_set('datadog.env', 'changed-env');
ini_set('datadog.version', 'changed-version');
// Use the same flag and subject throughout. Only application identity may
// separate these observations; earlier observations must not be relabelled.
foreach (array(
array(),
array('service' => 'app-a', 'env' => 'test', 'version' => 'v1'),
array('service' => 'app-b'),
array('env' => 'production'),
array('version' => 'v2'),
) as $settings) {
foreach ($settings as $key => $value) {
ini_set('datadog.' . $key, $value);
}
if (!\DDTrace\Internal\record_ffe_flag_evaluation(
$flag, 'blue', null, null, array(), null, false, false, 1700000000123
'same-flag', 'blue', null, null, array(), null, false, false, 1700000000123
)) throw new RuntimeException('submission rejected');
}
dd_trace_synchronous_flush();
4 changes: 2 additions & 2 deletions tracer/ffe.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ bool ddtrace_ffe_record_flag_evaluation(zend_string *flag_key, zend_string *vari
.runtime_default_used = runtime_default_used,
.observe_full_evaluation_data = observe_full_evaluation_data,
};
// Sidecar application attribution is deferred to FFL-3438/FFL-3439.
// The current FFI still requires a context argument.
// The sidecar snapshots the connection's application before aggregation.
// Do not copy service, environment, and version with every evaluation.
ddog_FfeTelemetryContext context = {0};
ddog_FfeSubmissionStatus status = ddog_sidecar_try_submit_ffe_flag_evaluation(
DATADOG_G(sidecar), &context, &event,
Expand Down
Loading