Skip to content

Commit 3172f33

Browse files
committed
feat(data-pipeline-ffi): add functions to manipulate span from C
Signed-off-by: Alexandre Rulleau <[email protected]>
1 parent a6d0f84 commit 3172f33

File tree

4 files changed

+491
-2
lines changed

4 files changed

+491
-2
lines changed

data-pipeline-ffi/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ build_common = { path = "../build-common" }
2424
[dev-dependencies]
2525
httpmock = "0.7.0"
2626
rmp-serde = "1.1.1"
27-
datadog-trace-utils = { path = "../trace-utils" }
2827

2928
[dependencies]
3029
data-pipeline = { path = "../data-pipeline" }
3130
ddcommon-ffi = { path = "../ddcommon-ffi", default-features = false }
3231
tinybytes = { path = "../tinybytes" }
32+
datadog-trace-utils = { path = "../trace-utils" }

data-pipeline-ffi/cbindgen.toml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,14 @@
44
language = "C"
55
cpp_compat = true
66
tab_width = 2
7-
header = """// Copyright 2021-Present Datadog, Inc. https://www.datadoghq.com/
7+
header = """// Copyright 2024-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;
915
"""
1016
include_guard = "DDOG_DATA_PIPELINE_H"
1117
includes = ["common.h"]
@@ -23,6 +29,9 @@ renaming_overrides_prefixing = true
2329
"ExporterResponse" = "ddog_TraceExporterResponse"
2430
"ExporterErrorCode" = "ddog_TraceExporterErrorCode"
2531
"ExporterError" = "ddog_TraceExporterError"
32+
"Span" = "ddog_Span"
33+
"SpanBytes" = "ddog_SpanBytes"
34+
"SpanText" = "ddog_SpanText"
2635

2736
[export.mangle]
2837
rename_types = "PascalCase"
@@ -37,3 +46,6 @@ must_use = "DDOG_CHECK_RETURN"
3746
[parse]
3847
parse_deps = true
3948
include = ["ddcommon", "ddcommon-ffi", "data-pipeline"]
49+
50+
[parse.expand]
51+
crates = ["data-pipeline-ffi"]

data-pipeline-ffi/src/lib.rs

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

99
mod error;
1010
mod response;
11+
mod span;
1112
mod trace_exporter;

0 commit comments

Comments
 (0)