Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
89df077
wip: first draft
Leiyks Jun 12, 2026
69b13e2
chore: drop integration analytics
Leiyks Jul 16, 2026
a5263de
feat(tracer): align C span code with v1-compatible stub API
Leiyks Jul 17, 2026
f49b1e4
fix(config): regenerate supported-configurations.json after dropping …
Leiyks Jul 20, 2026
1045a4c
fix(tracer): drop redundant env/version redeclaration on RootSpanData
Leiyks Jul 20, 2026
f86dd29
fix(tracer): initialize SpanData/SpanStack attributes to empty array …
Leiyks Jul 20, 2026
e1ad8e1
test: align tests with per-integration analytics removal
Leiyks Jul 20, 2026
6644c63
chore(tracer): trim verbose comments added by span-consistency work
Leiyks Jul 21, 2026
85214b1
chore(signals): drop stale TODO on legacy backtrace handler
Leiyks Jul 22, 2026
9336fbd
feat(tracer): deprecate App Analytics API to a no-op
Leiyks Jul 27, 2026
5fc45a2
chore(libdatadog): bump submodule to v1 sidecar (#2156)
Leiyks Aug 3, 2026
46b9a95
chore: bump libdatadog to v1 send FFI + regenerate headers
Leiyks Aug 3, 2026
5625a4d
chore: bump libdatadog to include V1 /v1.0/traces routing fix
Leiyks Aug 3, 2026
ab83e8b
feat(tracer): gate trace flush on DD_TRACE_AGENT_PROTOCOL_VERSION for…
Leiyks Aug 3, 2026
a2bd342
feat(tracer): emit native span links/events on the v1 path
Leiyks Aug 3, 2026
6a85e47
feat(tracer): negotiate v1 via agent /info with v04 fallback
Leiyks Aug 3, 2026
3b077e1
chore: regenerate supported-configurations.json for DD_TRACE_AGENT_PR…
Leiyks Aug 4, 2026
8d1b5a7
chore(tracer): tighten v1 comments
Leiyks Aug 5, 2026
84351df
chore(libdatadog): sync submodule to v1 FFI branch tip
Leiyks Aug 5, 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
3 changes: 3 additions & 0 deletions Cargo.lock

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

21 changes: 19 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,19 @@ 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 }
arc-swap = "1.7.1"
arc-swap = { version = "1.7.1", default-features = false }
bolero = { version = "0.13.4", default-features = false }
chrono = { version = "0.4.38", default-features = false }
clap = { version = "4.3.21", default-features = false }
criterion = { version = "0.5.1", default-features = true }
cxx-build = { version = "1.0", default-features = false }
elf = { version = "0.7", default-features = false }
futures = { version = "0.3", default-features = false }
hyper = { version = "1.6", features = [
"http1",
"client",
Expand All @@ -52,12 +61,20 @@ hyper-util = { version = "0.1.10", features = [
"client",
"client-legacy",
] }
io-lifetimes = { version = "1.0", default-features = false }
libc = { version = "0.2", default-features = true }
prost-build = { version = "0.14.1", default-features = false }
protoc-bin-vendored = { version = "3.0.0", default-features = false }
rustls = { version = "0.23", default-features = false }
serde = { version = "1.0", default-features = false }
serde_json = { version = "1.0", default-features = false, features = ["alloc"] }
syn = { version = "^2", default-features = false }
tempfile = { version = "3.13", default-features = false, features = [
"getrandom",
] }
tokio = { version = "1.36", default-features = false }
tracing = { version = "0.1", default-features = false }
uuid = { version = "1.7.0", default-features = false }

[workspace.lints]
# empty for compat with libdatadog
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
20 changes: 20 additions & 0 deletions components-rs/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -1309,6 +1309,26 @@ typedef struct ddog_SenderParameters {
ddog_CharSlice url;
} ddog_SenderParameters;

/**
* Payload-level tracer metadata consumed by the V1 msgpack encoder. Each field mirrors the
* corresponding field on `libdd_trace_utils::tracer_metadata::TracerMetadata`; empty slices are
* tolerated (the encoder falls back to span meta / omits the field).
*/
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
10 changes: 10 additions & 0 deletions components-rs/datadog.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,16 @@ char *ddog_agent_info_as_json(struct ddog_AgentInfoReader *reader);

void ddog_agent_info_json_free(char *ptr);

/**
* Returns true when the agent /info `endpoints` list advertises `endpoint`
* (e.g. `/v1.0/traces`). Returns false when no info has been received yet, so the
* caller safely treats "agent info unknown" as "endpoint 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
31 changes: 31 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 @@ -461,6 +482,16 @@ 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);

/**
* Encodes `traces` as a V1 msgpack `TracerPayload` (using `metadata` for the payload-level
* fields) and sends it to the sidecar, which re-encodes it for the agent's `/v1.0/traces`
* endpoint. Mirrors `ddog_send_traces_to_sidecar` (v04) for the SHM allocation, per-span dedup,
* `size_hint` derivation and the shm→bytes send fallback.
*/
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 104 files
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
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,6 @@ class FrankenphpIntegration extends Integration

public static $is_hooked;

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

public static function init(): int
{
ini_set("datadog.trace.auto_flush_enabled", 1);
Expand Down Expand Up @@ -55,7 +47,6 @@ static function (HookData $hook) use (&$blockingException, &$rootSpan) {
$rootSpan->meta[Tag::COMPONENT] = self::NAME;
$rootSpan->meta[Tag::SPAN_KIND] = Tag::SPAN_KIND_VALUE_SERVER;
unset($rootSpan->meta["closure.declaration"]);
self::addTraceAnalyticsIfEnabled($rootSpan);

consume_distributed_tracing_headers(null);

Expand Down
Loading
Loading