Skip to content
Draft
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
893b467
wip: first draft
Leiyks Jun 12, 2026
4ebccd9
chore: drop integration analytics
Leiyks Jul 16, 2026
3c2c3c8
feat(tracer): align C span code with v1-compatible stub API
Leiyks Jul 17, 2026
d4ff654
fix(config): regenerate supported-configurations.json after dropping …
Leiyks Jul 20, 2026
222567d
fix(tracer): drop redundant env/version redeclaration on RootSpanData
Leiyks Jul 20, 2026
ee993e9
fix(tracer): initialize SpanData/SpanStack attributes to empty array …
Leiyks Jul 20, 2026
45fad2e
test: align tests with per-integration analytics removal
Leiyks Jul 20, 2026
32d4d08
chore(tracer): trim verbose comments added by span-consistency work
Leiyks Jul 21, 2026
6f268b9
chore(signals): drop stale TODO on legacy backtrace handler
Leiyks Jul 22, 2026
5f105bf
feat(tracer): deprecate App Analytics API to a no-op
Leiyks Jul 27, 2026
a51a6a5
chore(libdatadog): bump submodule to v1 sidecar (#2156)
Leiyks Aug 3, 2026
e9635f9
chore: bump libdatadog to v1 send FFI + regenerate headers
Leiyks Aug 3, 2026
22520b4
feat(tracer): gate trace flush on DD_TRACE_AGENT_PROTOCOL_VERSION for…
Leiyks Aug 3, 2026
8235cf2
feat(tracer): emit native span links/events on the v1 path
Leiyks Aug 3, 2026
3191f42
feat(tracer): negotiate v1 via agent /info with v04 fallback
Leiyks Aug 3, 2026
afc4e46
chore: regenerate supported-configurations.json for DD_TRACE_AGENT_PR…
Leiyks Aug 4, 2026
318ff43
chore(tracer): tighten v1 comments
Leiyks Aug 5, 2026
0d3d03d
chore: regenerate cbindgen headers and Cargo.lock for libdatadog v1 FFI
Leiyks Aug 24, 2026
409a01a
feat(tracer): build & send native v1 traces on the sidecar path
Leiyks Aug 26, 2026
24cdec1
refactor(serializer): drop hand-written v1 macro FFI header
Leiyks Aug 26, 2026
601fdce
chore(libdatadog): bump to v1 serialize-to-bytes FFI + regenerate cbi…
Leiyks Aug 26, 2026
6c57076
feat(tracer): build native v1 payload directly on the sidecar path
Leiyks Aug 31, 2026
134be51
feat(tracer): wire v1 span debug-log on the sidecar path
Leiyks Aug 31, 2026
15776f5
fix(tracer): surface v1 meta_struct in serialize introspection
Leiyks Aug 31, 2026
b8b8b76
test: update .phpt expectations for v1 serialization shape (batch 1: …
Leiyks Aug 31, 2026
71dfa8e
test: update .phpt expectations for v1 serialization shape (batch 2: …
Leiyks Aug 31, 2026
8fdc524
test: update .phpt expectations for v1 serialization shape (batch 3: …
Leiyks Aug 31, 2026
0811097
test: update .phpt expectations for v1 serialization shape (batch 4: …
Leiyks Aug 31, 2026
4f79c79
test(request-replayer): decode v1 (/v1.0/traces) wire to the v0.4 spa…
Leiyks Aug 31, 2026
8a40a29
fix(tracer): make serialize introspection uniformly v1-shape
Leiyks Sep 1, 2026
6ada4ed
refactor: drop dead deprecated env/version handling and unused import
Leiyks Sep 1, 2026
65c1b40
test: sweep tests/ext expectations to v1 serialization shape
Leiyks Sep 1, 2026
8ae6245
chore(libdatadog): bump to direct V1 builder FFI + regenerate cbindge…
Leiyks Sep 3, 2026
230f6f0
feat(tracer): build native V1 payload directly on the sidecar path
Leiyks Sep 3, 2026
b401fa6
feat(tracer): downgrade to v0.4 on the in-process sender, flip sideca…
Leiyks Sep 3, 2026
2f12c18
feat(tracer): drop the PHP-version gate on the sidecar sender default
Leiyks Sep 3, 2026
00f0c2f
test: cover V1/v0.4 wire shape for background-sender + request-replayer
Leiyks Sep 3, 2026
14d6be6
fix(ext): include <stdbool.h> in agent_info.h for PHP 7.x build
Leiyks Sep 3, 2026
eacc054
docs(tracer): tighten V1-migration comments; bump libdatadog
Leiyks Sep 3, 2026
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: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ inherits = "release"
# inheritance against this manifest when built as path dependencies. Keep this
# list in sync with libdatadog's own `[workspace.dependencies]`; libdatadog
# #2253 consolidated `anyhow`, `serde`, `tokio` and `tracing` to the workspace
# level, so they are mirrored here too.
# level, and later work moved the rest of libdatadog's shared deps there too, so
# the full list is mirrored here.
[workspace.dependencies]
allocator-api2 = { version = "0.2.21", default-features = false }
anyhow = { version = "1.0", default-features = false }
Expand Down
26 changes: 25 additions & 1 deletion components-rs/agent_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

use crate::stats::apply_concentrator_config;
use datadog_sidecar::service::agent_info::AgentInfoReader;
use libdd_common_ffi::slice::CharSlice;
use libdd_common_ffi::slice::{AsBytes, CharSlice};
use libdd_data_pipeline::agent_info::schema::AgentInfoStruct;
use std::ffi::c_char;
use std::ffi::CString;
Expand Down Expand Up @@ -96,6 +96,30 @@ pub extern "C" fn ddog_agent_info_json_free(ptr: *mut c_char) {
}
}

/// Returns whether the agent /info `endpoints` list advertises `endpoint` (e.g. `/v1.0/traces`);
/// false when no info has been received yet ("unknown" == "not advertised").
///
/// # Safety
/// `reader` must be a valid pointer to an `AgentInfoReader`.
#[no_mangle]
pub unsafe extern "C" fn ddog_agent_info_has_endpoint(
reader: &mut AgentInfoReader,
endpoint: CharSlice,
) -> bool {
let (changed, info) = reader.read();
if let Some(info) = info {
if changed {
info_to_concentrator_config(info);
}
let endpoint = endpoint.as_bytes();
return info
.endpoints
.as_deref()
.map_or(false, |eps| eps.iter().any(|e| e.as_bytes() == endpoint));
}
false
}

/// Apply concentrator config changes from the agent /info SHM.
///
/// Cheap no-op when the SHM has not changed (`changed == false`). Only applies when
Expand Down
19 changes: 19 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 @@ -1352,6 +1353,24 @@ typedef struct ddog_SenderParameters {
ddog_CharSlice url;
} ddog_SenderParameters;

/**
* Payload-level tracer metadata for the V1 msgpack encoder; mirrors `TracerMetadata`.
*/
typedef struct ddog_TracerMetadataV1 {
ddog_CharSlice hostname;
ddog_CharSlice env;
ddog_CharSlice app_version;
ddog_CharSlice runtime_id;
ddog_CharSlice service;
ddog_CharSlice tracer_version;
ddog_CharSlice language_name;
ddog_CharSlice language_version;
ddog_CharSlice language_interpreter;
ddog_CharSlice language_interpreter_vendor;
ddog_CharSlice git_commit_sha;
ddog_CharSlice process_tags;
} ddog_TracerMetadataV1;

typedef enum ddog_crasht_BuildIdType {
DDOG_CRASHT_BUILD_ID_TYPE_GNU,
DDOG_CRASHT_BUILD_ID_TYPE_GO,
Expand Down
9 changes: 9 additions & 0 deletions components-rs/datadog.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,15 @@ char *ddog_agent_info_as_json(struct ddog_AgentInfoReader *reader);

void ddog_agent_info_json_free(char *ptr);

/**
* Returns whether the agent /info `endpoints` list advertises `endpoint` (e.g. `/v1.0/traces`);
* false when no info has been received yet ("unknown" == "not advertised").
*
* # Safety
* `reader` must be a valid pointer to an `AgentInfoReader`.
*/
bool ddog_agent_info_has_endpoint(struct ddog_AgentInfoReader *reader, ddog_CharSlice endpoint);

/**
* Apply concentrator config changes from the agent /info SHM.
*
Expand Down
29 changes: 29 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 Expand Up @@ -476,6 +497,14 @@ ddog_CharSlice ddog_get_agent_info_container_tags_hash(struct ddog_AgentInfoRead
void ddog_send_traces_to_sidecar(ddog_TracesBytes *traces,
struct ddog_SenderParameters *parameters);

/**
* V1 counterpart of `ddog_send_traces_to_sidecar`: encodes `traces` as a V1 `TracerPayload`
* using `metadata`, then sends it to the sidecar for the agent's `/v1.0/traces` endpoint.
*/
void ddog_send_traces_to_sidecar_v1(ddog_TracesBytes *traces,
struct ddog_SenderParameters *parameters,
const struct ddog_TracerMetadataV1 *metadata);

/**
* Drops the agent info reader.
*/
Expand Down
2 changes: 1 addition & 1 deletion libdatadog
Submodule libdatadog updated 53 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
+213 −0 datadog-sidecar-ffi/src/lib.rs
+1 −5 datadog-sidecar/Cargo.toml
+43 −0 datadog-sidecar/src/service/blocking.rs
+43 −0 datadog-sidecar/src/service/sender.rs
+51 −0 datadog-sidecar/src/service/sidecar_interface.rs
+272 −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
+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
14 changes: 7 additions & 7 deletions metadata/supported-configurations.json
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,13 @@
"default": "8126"
}
],
"DD_TRACE_AGENT_PROTOCOL_VERSION": [
{
"implementation": "A",
"type": "string",
"default": "0.4"
}
],
"DD_TRACE_AGENT_RETRIES": [
{
"implementation": "A",
Expand Down Expand Up @@ -2525,13 +2532,6 @@
"default": "true"
}
],
"DD_TRACE_WARN_LEGACY_DD_TRACE": [
{
"implementation": "A",
"type": "boolean",
"default": "true"
}
],
"DD_TRACE_WEBSOCKET_MESSAGES_ENABLED": [
{
"implementation": "A",
Expand Down
9 changes: 0 additions & 9 deletions src/DDTrace/Integrations/CakePHP/CakePHPIntegration.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@ class CakePHPIntegration extends Integration
public static $setStatusCodeFn;
public static $parseRouteFn;

/**
* {@inheritdoc}
*/
public static function requiresExplicitTraceAnalyticsEnabling(): bool
{
return false;
}

public static function init(): int
{
self::$setRootSpanInfoFn = static function () {
Expand All @@ -35,7 +27,6 @@ public static function init(): int
}

self::$appName = \ddtrace_config_app_name(CakePHPIntegration::NAME);
self::addTraceAnalyticsIfEnabled($rootSpan);
$rootSpan->service = self::$appName;
Integration::tagFrameworkServiceSource($rootSpan, CakePHPIntegration::NAME);
if ('cli' === PHP_SAPI) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ public static function init($router = null): int

public static function registerIntegration(\CI_Router $router, SpanData $rootSpan, $service)
{
self::addTraceAnalyticsIfEnabled($rootSpan);
$rootSpan->name = 'codeigniter.request';
$rootSpan->service = $service;
$rootSpan->type = Type::WEB_SERVLET;
Expand Down
1 change: 0 additions & 1 deletion src/DDTrace/Integrations/Curl/CurlIntegration.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@ public static function setup_curl_span($span) {
$span->type = Type::HTTP_CLIENT;
$span->service = 'curl';
Integration::handleInternalSpanServiceName($span, self::NAME);
self::addTraceAnalyticsIfEnabled($span);
$span->meta[Tag::COMPONENT] = self::NAME;
$span->meta[Tag::SPAN_KIND] = Tag::SPAN_KIND_VALUE_CLIENT;
}
Expand Down
10 changes: 0 additions & 10 deletions src/DDTrace/Integrations/Drupal/DrupalIntegration.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@ class DrupalIntegration extends Integration
{
const NAME = 'drupal';

/**
* {@inheritdoc}
*/
public static function requiresExplicitTraceAnalyticsEnabling(): bool
{
return false;
}

public static function init(): int
{
ini_set('datadog.trace.spans_limit', max(1500, ini_get('datadog.trace.spans_limit')));
Expand Down Expand Up @@ -183,8 +175,6 @@ static function (HookData $fnHookData) use ($hook, $module, $functionName) {
}
);



// View Metrics
/*
install_hook(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,16 @@ public static function init(): int
self::traceClientMethod('existsScource');
self::traceClientMethod('explain');
self::traceClientMethod('fieldCaps');
self::traceClientMethod('get', true);
self::traceClientMethod('get');
self::traceClientMethod('getScript');
self::traceClientMethod('getScriptContext');
self::traceClientMethod('getScriptLanguages');
self::traceClientMethod('getSource');
self::traceClientMethod('index');
self::traceClientMethod('knnSearch', true);
self::traceClientMethod('mget', true);
self::traceClientMethod('msearch', true);
self::traceClientMethod('msearchTemplate', true);
self::traceClientMethod('knnSearch');
self::traceClientMethod('mget');
self::traceClientMethod('msearch');
self::traceClientMethod('msearchTemplate');
self::traceClientMethod('mtermvectors');
self::traceClientMethod('openPointInTime');
self::traceClientMethod('ping');
Expand All @@ -76,11 +76,11 @@ public static function init(): int
self::traceClientMethod('renderSearchTemplate');
self::traceClientMethod('scriptsPainlessExecute');
self::traceClientMethod('scroll');
self::traceClientMethod('search', true);
self::traceClientMethod('searchMvt', true);
self::traceClientMethod('searchShards', true);
self::traceClientMethod('searchTemplate', true);
self::traceClientMethod('termsEnum', true);
self::traceClientMethod('search');
self::traceClientMethod('searchMvt');
self::traceClientMethod('searchShards');
self::traceClientMethod('searchTemplate');
self::traceClientMethod('termsEnum');
self::traceClientMethod('termvectors');
self::traceClientMethod('update');
self::traceClientMethod('updateByQuery');
Expand Down Expand Up @@ -136,9 +136,8 @@ public static function init(): int
}
/**
* @param string $name
* @param bool $isTraceAnalyticsCandidate
*/
public static function traceClientMethod($name, $isTraceAnalyticsCandidate = false)
public static function traceClientMethod($name)
{
$class = 'Elasticsearch\Client';

Expand All @@ -152,13 +151,9 @@ public static function traceClientMethod($name, $isTraceAnalyticsCandidate = fal
$class,
$name,
[
'prehook' => static function (SpanData $span, $args) use ($name, $isTraceAnalyticsCandidate) {
'prehook' => static function (SpanData $span, $args) use ($name) {
$span->name = "Elasticsearch.Client.$name";

if ($isTraceAnalyticsCandidate) {
self::addTraceAnalyticsIfEnabled($span);
}

$span->meta[Tag::SPAN_KIND] = 'client';
Integration::handleInternalSpanServiceName($span, self::NAME);
$span->type = Type::ELASTICSEARCH;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ public static function traceClientMethod($name, $isTraceAnalyticsCandidate = fal
$span->name = "Elasticsearch.Client.$name";

if ($isTraceAnalyticsCandidate) {
self::addTraceAnalyticsIfEnabled($span);
self::$logNextBody = true;
}

Expand Down
Loading
Loading