Skip to content

Commit a7e3141

Browse files
committed
feat: move span code to sidecar-ffi
Signed-off-by: Alexandre Rulleau <[email protected]>
1 parent b7f5437 commit a7e3141

File tree

8 files changed

+138
-142
lines changed

8 files changed

+138
-142
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

data-pipeline-ffi/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ build_common = { path = "../build-common" }
2323

2424
[dev-dependencies]
2525
httpmock = "0.7.0"
26+
rmp-serde = "1.1.1"
27+
datadog-trace-utils = { path = "../datadog-trace-utils" }
2628

2729
[dependencies]
2830
data-pipeline = { path = "../data-pipeline" }
29-
datadog-trace-utils = { path = "../datadog-trace-utils" }
3031
ddcommon-ffi = { path = "../ddcommon-ffi", default-features = false }
31-
rmp-serde = "1.1.1"
3232
tinybytes = { path = "../tinybytes" }

data-pipeline-ffi/cbindgen.toml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,8 @@
44
language = "C"
55
cpp_compat = true
66
tab_width = 2
7-
header = """// Copyright 2024-Present Datadog, Inc. https://www.datadoghq.com/
7+
header = """// Copyright 2021-Present Datadog, Inc. https://www.datadoghq.com/
88
// SPDX-License-Identifier: Apache-2.0
9-
10-
typedef struct ddog_SpanBytes ddog_SpanBytes;
11-
typedef struct ddog_SpanLinkBytes ddog_SpanLinkBytes;
12-
typedef struct ddog_SpanEventBytes ddog_SpanEventBytes;
13-
typedef struct ddog_AttributeAnyValueBytes ddog_AttributeAnyValueBytes;
14-
typedef struct ddog_AttributeArrayValueBytes ddog_AttributeArrayValueBytes;
159
"""
1610
include_guard = "DDOG_DATA_PIPELINE_H"
1711
includes = ["common.h"]
@@ -29,9 +23,6 @@ renaming_overrides_prefixing = true
2923
"ExporterResponse" = "ddog_TraceExporterResponse"
3024
"ExporterErrorCode" = "ddog_TraceExporterErrorCode"
3125
"ExporterError" = "ddog_TraceExporterError"
32-
"Span" = "ddog_Span"
33-
"SpanBytes" = "ddog_SpanBytes"
34-
"SpanText" = "ddog_SpanText"
3526

3627
[export.mangle]
3728
rename_types = "PascalCase"

data-pipeline-ffi/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@
88

99
mod error;
1010
mod response;
11-
pub mod span;
1211
mod trace_exporter;

datadog-sidecar-ffi/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ ddcommon-ffi = { path = "../ddcommon-ffi", default-features = false }
2020
ddtelemetry-ffi = { path = "../ddtelemetry-ffi", default-features = false }
2121
datadog-remote-config = { path = "../datadog-remote-config" }
2222
datadog-live-debugger = { path = "../datadog-live-debugger" }
23+
dogstatsd-client = { path = "../dogstatsd-client" }
24+
tinybytes = { path = "../tinybytes" }
2325
paste = "1"
2426
libc = "0.2"
25-
dogstatsd-client = { path = "../dogstatsd-client" }
2627
tracing = { version = "0.1", default-features = false }
27-
data-pipeline-ffi = { path = "../data-pipeline-ffi" }
2828
rmp-serde = "1.1.1"
2929

3030

datadog-sidecar-ffi/cbindgen.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ language = "C"
55
tab_width = 2
66
header = """// Copyright 2021-Present Datadog, Inc. https://www.datadoghq.com/
77
// SPDX-License-Identifier: Apache-2.0
8+
9+
typedef struct ddog_SpanBytes ddog_SpanBytes;
10+
typedef struct ddog_SpanLinkBytes ddog_SpanLinkBytes;
11+
typedef struct ddog_SpanEventBytes ddog_SpanEventBytes;
12+
typedef struct ddog_AttributeAnyValueBytes ddog_AttributeAnyValueBytes;
13+
typedef struct ddog_AttributeArrayValueBytes ddog_AttributeArrayValueBytes;
814
"""
915
include_guard = "DDOG_SIDECAR_H"
1016
style = "both"

datadog-sidecar-ffi/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
#![cfg_attr(not(test), deny(clippy::todo))]
88
#![cfg_attr(not(test), deny(clippy::unimplemented))]
99

10-
use data_pipeline_ffi::span::TracesBytes;
10+
pub mod span;
11+
12+
use crate::span::TracesBytes;
1113
#[cfg(windows)]
1214
use datadog_crashtracker_ffi::Metadata;
1315
use datadog_ipc::platform::{
@@ -1114,4 +1116,4 @@ pub unsafe extern "C" fn ddog_send_traces_to_sidecar(
11141116
/// Drops the agent info reader.
11151117
#[no_mangle]
11161118
#[allow(clippy::missing_safety_doc)]
1117-
pub unsafe extern "C" fn ddog_drop_agent_info_reader(_: Box<AgentInfoReader>) {}
1119+
pub unsafe extern "C" fn ddog_drop_agent_info_reader(_: Box<AgentInfoReader>) {}

0 commit comments

Comments
 (0)