libdatadog 48.0.0.1.1 → 49.0.0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/lib/libdatadog/version.rb +2 -1
  3. data/vendor/{libdatadog-48.0.0/aarch64-linux-musl → libdatadog-49.0.0/aarch64-linux}/LICENSE-3rdparty.csv +11 -0
  4. data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/aarch64-linux/bin/libdatadog-crashtracking-receiver +0 -0
  5. data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/aarch64-linux/include/datadog/common.h +119 -0
  6. data/vendor/{libdatadog-48.0.0/aarch64-linux-musl → libdatadog-49.0.0/aarch64-linux}/include/datadog/data-pipeline.h +449 -0
  7. data/vendor/{libdatadog-48.0.0/x86_64-linux-musl → libdatadog-49.0.0/aarch64-linux}/include/datadog/profiling.h +4 -5
  8. data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/aarch64-linux/include/datadog/shared-runtime.h +17 -0
  9. data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/aarch64-linux/lib/libdatadog_profiling.so +0 -0
  10. data/vendor/{libdatadog-48.0.0/arm64-darwin → libdatadog-49.0.0/aarch64-linux}/lib/pkgconfig/datadog_profiling_with_rpath.pc +1 -1
  11. data/vendor/{libdatadog-48.0.0/aarch64-linux → libdatadog-49.0.0/aarch64-linux-musl}/LICENSE-3rdparty.csv +11 -0
  12. data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/aarch64-linux-musl/bin/libdatadog-crashtracking-receiver +0 -0
  13. data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/aarch64-linux-musl/include/datadog/common.h +119 -0
  14. data/vendor/{libdatadog-48.0.0/aarch64-linux → libdatadog-49.0.0/aarch64-linux-musl}/include/datadog/data-pipeline.h +449 -0
  15. data/vendor/{libdatadog-48.0.0/arm64-darwin → libdatadog-49.0.0/aarch64-linux-musl}/include/datadog/profiling.h +4 -5
  16. data/vendor/{libdatadog-48.0.0/arm64-darwin → libdatadog-49.0.0/aarch64-linux-musl}/include/datadog/shared-runtime.h +17 -0
  17. data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/aarch64-linux-musl/lib/libdatadog_profiling.so +0 -0
  18. data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/aarch64-linux-musl/lib/pkgconfig/datadog_profiling_with_rpath.pc +1 -1
  19. data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/arm64-darwin/LICENSE-3rdparty.csv +11 -0
  20. data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/arm64-darwin/include/datadog/common.h +119 -0
  21. data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/arm64-darwin/include/datadog/data-pipeline.h +449 -0
  22. data/vendor/{libdatadog-48.0.0/aarch64-linux-musl → libdatadog-49.0.0/arm64-darwin}/include/datadog/profiling.h +4 -5
  23. data/vendor/{libdatadog-48.0.0/aarch64-linux-musl → libdatadog-49.0.0/arm64-darwin}/include/datadog/shared-runtime.h +17 -0
  24. data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/arm64-darwin/lib/libdatadog_profiling.dylib +0 -0
  25. data/vendor/{libdatadog-48.0.0/x86_64-linux-musl → libdatadog-49.0.0/arm64-darwin}/lib/pkgconfig/datadog_profiling_with_rpath.pc +1 -1
  26. data/vendor/libdatadog-49.0.0/x86_64-linux/LICENSE-3rdparty.csv +572 -0
  27. data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/x86_64-linux/bin/libdatadog-crashtracking-receiver +0 -0
  28. data/vendor/libdatadog-49.0.0/x86_64-linux/include/datadog/common.h +3411 -0
  29. data/vendor/libdatadog-49.0.0/x86_64-linux/include/datadog/data-pipeline.h +1181 -0
  30. data/vendor/libdatadog-49.0.0/x86_64-linux/include/datadog/profiling.h +1166 -0
  31. data/vendor/libdatadog-49.0.0/x86_64-linux/include/datadog/shared-runtime.h +108 -0
  32. data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/x86_64-linux/lib/libdatadog_profiling.so +0 -0
  33. data/vendor/libdatadog-49.0.0/x86_64-linux/lib/pkgconfig/datadog_profiling_with_rpath.pc +15 -0
  34. data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/x86_64-linux-musl/LICENSE-3rdparty.csv +11 -0
  35. data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/x86_64-linux-musl/bin/libdatadog-crashtracking-receiver +0 -0
  36. data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/x86_64-linux-musl/include/datadog/common.h +119 -0
  37. data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/x86_64-linux-musl/include/datadog/data-pipeline.h +449 -0
  38. data/vendor/{libdatadog-48.0.0/aarch64-linux → libdatadog-49.0.0/x86_64-linux-musl}/include/datadog/profiling.h +4 -5
  39. data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/x86_64-linux-musl/include/datadog/shared-runtime.h +17 -0
  40. data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/x86_64-linux-musl/lib/libdatadog_profiling.so +0 -0
  41. data/vendor/{libdatadog-48.0.0/aarch64-linux → libdatadog-49.0.0/x86_64-linux-musl}/lib/pkgconfig/datadog_profiling_with_rpath.pc +1 -1
  42. metadata +91 -91
  43. data/vendor/libdatadog-48.0.0/x86_64-linux/LICENSE-3rdparty.csv +0 -561
  44. data/vendor/libdatadog-48.0.0/x86_64-linux/include/datadog/common.h +0 -3292
  45. data/vendor/libdatadog-48.0.0/x86_64-linux/include/datadog/data-pipeline.h +0 -732
  46. data/vendor/libdatadog-48.0.0/x86_64-linux/include/datadog/profiling.h +0 -1167
  47. data/vendor/libdatadog-48.0.0/x86_64-linux/include/datadog/shared-runtime.h +0 -91
  48. data/vendor/libdatadog-48.0.0/x86_64-linux/lib/pkgconfig/datadog_profiling_with_rpath.pc +0 -15
  49. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/aarch64-linux/LICENSE +0 -0
  50. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/aarch64-linux/NOTICE +0 -0
  51. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/aarch64-linux/include/datadog/blazesym.h +0 -0
  52. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/aarch64-linux/include/datadog/crashtracker.h +0 -0
  53. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/aarch64-linux/include/datadog/ddsketch.h +0 -0
  54. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/aarch64-linux/include/datadog/ffe.h +0 -0
  55. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/aarch64-linux/include/datadog/library-config.h +0 -0
  56. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/aarch64-linux/include/datadog/log.h +0 -0
  57. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/aarch64-linux/include/datadog/otel-thread-ctx.h +0 -0
  58. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/aarch64-linux/include/datadog/telemetry.h +0 -0
  59. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/aarch64-linux-musl/LICENSE +0 -0
  60. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/aarch64-linux-musl/NOTICE +0 -0
  61. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/aarch64-linux-musl/include/datadog/blazesym.h +0 -0
  62. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/aarch64-linux-musl/include/datadog/crashtracker.h +0 -0
  63. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/aarch64-linux-musl/include/datadog/ddsketch.h +0 -0
  64. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/aarch64-linux-musl/include/datadog/ffe.h +0 -0
  65. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/aarch64-linux-musl/include/datadog/library-config.h +0 -0
  66. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/aarch64-linux-musl/include/datadog/log.h +0 -0
  67. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/aarch64-linux-musl/include/datadog/otel-thread-ctx.h +0 -0
  68. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/aarch64-linux-musl/include/datadog/telemetry.h +0 -0
  69. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/arm64-darwin/LICENSE +0 -0
  70. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/arm64-darwin/NOTICE +0 -0
  71. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/arm64-darwin/bin/libdatadog-crashtracking-receiver +0 -0
  72. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/arm64-darwin/include/datadog/blazesym.h +0 -0
  73. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/arm64-darwin/include/datadog/crashtracker.h +0 -0
  74. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/arm64-darwin/include/datadog/ddsketch.h +0 -0
  75. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/arm64-darwin/include/datadog/ffe.h +0 -0
  76. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/arm64-darwin/include/datadog/library-config.h +0 -0
  77. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/arm64-darwin/include/datadog/log.h +0 -0
  78. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/arm64-darwin/include/datadog/otel-thread-ctx.h +0 -0
  79. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/arm64-darwin/include/datadog/telemetry.h +0 -0
  80. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/x86_64-linux/LICENSE +0 -0
  81. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/x86_64-linux/NOTICE +0 -0
  82. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/x86_64-linux/include/datadog/blazesym.h +0 -0
  83. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/x86_64-linux/include/datadog/crashtracker.h +0 -0
  84. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/x86_64-linux/include/datadog/ddsketch.h +0 -0
  85. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/x86_64-linux/include/datadog/ffe.h +0 -0
  86. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/x86_64-linux/include/datadog/library-config.h +0 -0
  87. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/x86_64-linux/include/datadog/log.h +0 -0
  88. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/x86_64-linux/include/datadog/otel-thread-ctx.h +0 -0
  89. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/x86_64-linux/include/datadog/telemetry.h +0 -0
  90. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/x86_64-linux-musl/LICENSE +0 -0
  91. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/x86_64-linux-musl/NOTICE +0 -0
  92. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/x86_64-linux-musl/include/datadog/blazesym.h +0 -0
  93. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/x86_64-linux-musl/include/datadog/crashtracker.h +0 -0
  94. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/x86_64-linux-musl/include/datadog/ddsketch.h +0 -0
  95. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/x86_64-linux-musl/include/datadog/ffe.h +0 -0
  96. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/x86_64-linux-musl/include/datadog/library-config.h +0 -0
  97. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/x86_64-linux-musl/include/datadog/log.h +0 -0
  98. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/x86_64-linux-musl/include/datadog/otel-thread-ctx.h +0 -0
  99. /data/vendor/{libdatadog-48.0.0 → libdatadog-49.0.0}/x86_64-linux-musl/include/datadog/telemetry.h +0 -0
@@ -0,0 +1,1181 @@
1
+ // Copyright 2021-Present Datadog, Inc. https://www.datadoghq.com/
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+
5
+ #ifndef DDOG_DATA_PIPELINE_H
6
+ #define DDOG_DATA_PIPELINE_H
7
+
8
+ #include <stdarg.h>
9
+ #include <stdbool.h>
10
+ #include <stdint.h>
11
+ #include <stdlib.h>
12
+ #include "common.h"
13
+ #ifndef DDOG_TRACE_EXPORTER_DEPRECATED
14
+ #if defined(_MSC_VER)
15
+ #define DDOG_TRACE_EXPORTER_DEPRECATED(message) __declspec(deprecated(message))
16
+ #elif defined(__GNUC__) || defined(__clang__)
17
+ #define DDOG_TRACE_EXPORTER_DEPRECATED(message) __attribute__((deprecated(message)))
18
+ #else
19
+ #define DDOG_TRACE_EXPORTER_DEPRECATED(message)
20
+ #endif
21
+ #endif
22
+
23
+ #ifdef __cplusplus
24
+ extern "C" {
25
+ #endif // __cplusplus
26
+
27
+ /**
28
+ * Frees `error` and all its contents. After being called error will not point to a valid memory
29
+ * address so any further actions on it could lead to undefined behavior.
30
+ */
31
+ void ddog_trace_exporter_error_free(struct ddog_TraceExporterError *error);
32
+
33
+ /**
34
+ * Select external observation delivery and disable native telemetry delivery.
35
+ *
36
+ * # Safety
37
+ * `config`, when non-null, must be a live, exclusively borrowed configuration.
38
+ */
39
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_enable_observations(struct ddog_TraceExporterConfig *config);
40
+
41
+ /**
42
+ * Send chunks with caller-owned observations on success, failure, or cancellation.
43
+ * Native telemetry is not submitted for this operation. Both outputs are initialised
44
+ * before validation; invalid input and contained panics leave zero observations.
45
+ * `chunks` is consumed on every return, including invalid arguments and panics.
46
+ *
47
+ * # Safety
48
+ * Non-null pointers must be valid for their types. Output slots must be writable,
49
+ * unaliased, and contain no live owned response. Free a returned response with
50
+ * `ddog_trace_exporter_response_free`; observations require no cleanup.
51
+ */
52
+ struct ddog_TraceExporterError *ddog_trace_exporter_send_trace_chunks_observed(const ddog_TraceExporter *exporter,
53
+ ddog_TracerTraceChunks *chunks,
54
+ struct ddog_TraceExporterResponse **response_out,
55
+ struct ddog_TraceExporterObservations *observations_out,
56
+ const ddog_TraceExporterCancelToken *cancel);
57
+
58
+ /**
59
+ * Return a borrowed view of the response body. The returned slice is
60
+ * only valid as long as `response` is alive. Returns an empty slice
61
+ * when `response` is null or the body is absent.
62
+ */
63
+ ddog_ByteSlice ddog_trace_exporter_response_get_body(const struct ddog_TraceExporterResponse *response);
64
+
65
+ /**
66
+ * Free `response` and all its contents. After being called response will not point to a valid
67
+ * memory address so any further actions on it could lead to undefined behavior.
68
+ */
69
+ void ddog_trace_exporter_response_free(struct ddog_TraceExporterResponse *response);
70
+
71
+ /**
72
+ * Encode one flat preorder structured value as an owned MessagePack blob.
73
+ *
74
+ * On success, `out_handle` receives an owned blob that must be freed with
75
+ * [`ddog_tracer_encoded_value_free`]. The input is fully validated and must
76
+ * contain exactly one value. Token byte slices are borrowed only for this
77
+ * synchronous call; the returned blob does not retain them.
78
+ *
79
+ * # Safety
80
+ *
81
+ * `tokens` and every byte slice referenced by its tokens must remain valid for
82
+ * this call. `out_handle` must point to writable memory for a
83
+ * `Box<TracerEncodedValue>`.
84
+ */
85
+ struct ddog_TraceExporterError *ddog_tracer_encode_value(struct ddog_Slice_TracerValueToken tokens,
86
+ struct ddog_TracerEncodedValue **out_handle);
87
+
88
+ /**
89
+ * Borrow the bytes in an encoded value. The slice is valid until the blob is
90
+ * freed.
91
+ */
92
+ ddog_ByteSlice ddog_tracer_encoded_value_as_slice(const struct ddog_TracerEncodedValue *value);
93
+
94
+ /**
95
+ * Free an encoded structured value and its bytes.
96
+ */
97
+ void ddog_tracer_encoded_value_free(struct ddog_TracerEncodedValue *value);
98
+
99
+ DDOG_TRACE_EXPORTER_DEPRECATED("Use ddog_trace_exporter_builder_new instead")
100
+ void ddog_trace_exporter_config_new(struct ddog_TraceExporterConfig **out_handle);
101
+
102
+ /**
103
+ * Frees TraceExporterConfig handle internal resources.
104
+ */
105
+ DDOG_TRACE_EXPORTER_DEPRECATED("Use ddog_trace_exporter_builder_free instead")
106
+ void ddog_trace_exporter_config_free(struct ddog_TraceExporterConfig *handle);
107
+
108
+ /**
109
+ * Sets traces destination.
110
+ */
111
+ DDOG_TRACE_EXPORTER_DEPRECATED("Use ddog_trace_exporter_builder_set_url instead")
112
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_url(struct ddog_TraceExporterConfig *config,
113
+ ddog_CharSlice url);
114
+
115
+ /**
116
+ * Sets tracer's version to be included in the headers request.
117
+ */
118
+ DDOG_TRACE_EXPORTER_DEPRECATED("Use ddog_trace_exporter_builder_set_tracer_version instead")
119
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_tracer_version(struct ddog_TraceExporterConfig *config,
120
+ ddog_CharSlice version);
121
+
122
+ /**
123
+ * Sets tracer's language to be included in the headers request.
124
+ */
125
+ DDOG_TRACE_EXPORTER_DEPRECATED("Use ddog_trace_exporter_builder_set_language instead")
126
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_language(struct ddog_TraceExporterConfig *config,
127
+ ddog_CharSlice lang);
128
+
129
+ /**
130
+ * Sets tracer's language version to be included in the headers request.
131
+ */
132
+ DDOG_TRACE_EXPORTER_DEPRECATED("Use ddog_trace_exporter_builder_set_language_version instead")
133
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_lang_version(struct ddog_TraceExporterConfig *config,
134
+ ddog_CharSlice version);
135
+
136
+ /**
137
+ * Sets tracer's language interpreter to be included in the headers request.
138
+ */
139
+ DDOG_TRACE_EXPORTER_DEPRECATED("Use ddog_trace_exporter_builder_set_language_interpreter instead")
140
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_lang_interpreter(struct ddog_TraceExporterConfig *config,
141
+ ddog_CharSlice interpreter);
142
+
143
+ /**
144
+ * Sets hostname information to be included in the headers request.
145
+ */
146
+ DDOG_TRACE_EXPORTER_DEPRECATED("Use ddog_trace_exporter_builder_set_hostname instead")
147
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_hostname(struct ddog_TraceExporterConfig *config,
148
+ ddog_CharSlice hostname);
149
+
150
+ /**
151
+ * Sets environment information to be included in the headers request.
152
+ */
153
+ DDOG_TRACE_EXPORTER_DEPRECATED("Use ddog_trace_exporter_builder_set_env instead")
154
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_env(struct ddog_TraceExporterConfig *config,
155
+ ddog_CharSlice env);
156
+
157
+ DDOG_TRACE_EXPORTER_DEPRECATED("Use ddog_trace_exporter_builder_set_app_version instead")
158
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_version(struct ddog_TraceExporterConfig *config,
159
+ ddog_CharSlice version);
160
+
161
+ /**
162
+ * Sets service name to be included in the headers request.
163
+ */
164
+ DDOG_TRACE_EXPORTER_DEPRECATED("Use ddog_trace_exporter_builder_set_service instead")
165
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_service(struct ddog_TraceExporterConfig *config,
166
+ ddog_CharSlice service);
167
+
168
+ /**
169
+ * Enables health metrics emission.
170
+ */
171
+ DDOG_TRACE_EXPORTER_DEPRECATED("Use ddog_trace_exporter_builder_enable_health_metrics instead")
172
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_enable_health_metrics(struct ddog_TraceExporterConfig *config,
173
+ bool is_enabled);
174
+
175
+ /**
176
+ * Enables telemetry metrics.
177
+ */
178
+ DDOG_TRACE_EXPORTER_DEPRECATED("Use ddog_trace_exporter_builder_enable_telemetry instead")
179
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_enable_telemetry(struct ddog_TraceExporterConfig *config,
180
+ const struct ddog_TelemetryClientConfig *telemetry_cfg);
181
+
182
+ /**
183
+ * Set client-side stats computation status.
184
+ */
185
+ DDOG_TRACE_EXPORTER_DEPRECATED("Use ddog_trace_exporter_builder_enable_stats instead")
186
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_compute_stats(struct ddog_TraceExporterConfig *config,
187
+ bool is_enabled);
188
+
189
+ /**
190
+ * Indicates that the tracer has already marked top-level spans with `_dd.top_level`.
191
+ * Sets the `Datadog-Client-Computed-Top-Level` header without enabling stats computation.
192
+ */
193
+ DDOG_TRACE_EXPORTER_DEPRECATED("Use ddog_trace_exporter_builder_set_client_computed_top_level instead")
194
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_client_computed_top_level(struct ddog_TraceExporterConfig *config,
195
+ bool client_computed_top_level);
196
+
197
+ /**
198
+ * Sets `Datadog-Client-Computed-Stats` header to `true`.
199
+ * This indicates that the upstream system has already computed the stats,
200
+ * and no further stats computation should be performed.
201
+ *
202
+ * <div class="warning">
203
+ * This method must not be used when `compute_stats` is enabled, as it could
204
+ * result in duplicate stats computation.
205
+ * </div>
206
+ *
207
+ * A common use case is in Application Security Monitoring (ASM) scenarios:
208
+ * when APM is disabled but ASM is enabled, setting this header to `true`
209
+ * ensures that no stats are computed at any level (exporter or agent).
210
+ */
211
+ DDOG_TRACE_EXPORTER_DEPRECATED("Use ddog_trace_exporter_builder_set_client_computed_stats instead")
212
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_client_computed_stats(struct ddog_TraceExporterConfig *config,
213
+ bool client_computed_stats);
214
+
215
+ /**
216
+ * Shares a mutable metadata handle with the exporter config.
217
+ *
218
+ * When set, this supersedes `ddog_trace_exporter_config_set_process_tags` and
219
+ * `ddog_trace_exporter_config_set_runtime_id`.
220
+ */
221
+ DDOG_TRACE_EXPORTER_DEPRECATED("Use ddog_trace_exporter_builder_set_mutable_metadata instead")
222
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_mutable_metadata(struct ddog_TraceExporterConfig *config,
223
+ const ddog_MutableMetadataHandle *metadata);
224
+
225
+ /**
226
+ * Sets the process tags to be included in the stats payload.
227
+ *
228
+ * This should not be used when `ddog_trace_exporter_config_set_mutable_metadata` is used.
229
+ */
230
+ DDOG_TRACE_EXPORTER_DEPRECATED("Use ddog_trace_exporter_builder_set_process_tags instead")
231
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_process_tags(struct ddog_TraceExporterConfig *config,
232
+ ddog_CharSlice process_tags);
233
+
234
+ /**
235
+ * Sets the runtime id used in payloads.
236
+ *
237
+ * This should not be used when `ddog_trace_exporter_config_set_mutable_metadata` is used.
238
+ */
239
+ DDOG_TRACE_EXPORTER_DEPRECATED("Use ddog_trace_exporter_builder_set_runtime_id instead")
240
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_runtime_id(struct ddog_TraceExporterConfig *config,
241
+ ddog_CharSlice runtime_id);
242
+
243
+ /**
244
+ * Sets the `X-Datadog-Test-Session-Token` header. Only used for testing with the test agent.
245
+ */
246
+ DDOG_TRACE_EXPORTER_DEPRECATED("Use ddog_trace_exporter_builder_set_test_session_token instead")
247
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_test_session_token(struct ddog_TraceExporterConfig *config,
248
+ ddog_CharSlice token);
249
+
250
+ /**
251
+ * Sets the timeout in ms for all agent's connections.
252
+ */
253
+ DDOG_TRACE_EXPORTER_DEPRECATED("Use ddog_trace_exporter_builder_set_connection_timeout instead")
254
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_connection_timeout(struct ddog_TraceExporterConfig *config,
255
+ uint64_t timeout_ms);
256
+
257
+ /**
258
+ * Sets a shared runtime for the TraceExporter to use for background workers.
259
+ *
260
+ * `handle` must have been initialized with `ddog_shared_runtime_new`.
261
+ *
262
+ * When set, the exporter will use the provided runtime instead of creating its own.
263
+ * This allows multiple exporters (or other components) to share a single runtime.
264
+ * The config holds a clone of the `Arc` (increments the strong count), so the
265
+ * original handle remains valid and must still be freed with
266
+ * `ddog_shared_runtime_free`.
267
+ */
268
+ DDOG_TRACE_EXPORTER_DEPRECATED("Use ddog_trace_exporter_builder_set_shared_runtime instead")
269
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_shared_runtime(struct ddog_TraceExporterConfig *config,
270
+ struct ddog_ForkSafeRuntime *handle);
271
+
272
+ /**
273
+ * Enables OTLP trace export and sets the endpoint URL.
274
+ *
275
+ * When set, traces are sent to this URL using the protocol selected by
276
+ * `ddog_trace_exporter_config_set_otlp_protocol` instead of the Datadog agent. The host language
277
+ * is responsible for resolving the endpoint from its configuration (e.g.
278
+ * `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT`) before calling this function.
279
+ */
280
+ DDOG_TRACE_EXPORTER_DEPRECATED("Use ddog_trace_exporter_builder_set_otlp_endpoint instead")
281
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_otlp_endpoint(struct ddog_TraceExporterConfig *config,
282
+ ddog_CharSlice url);
283
+
284
+ /**
285
+ * Sets the OTLP export protocol. Accepts the OTel-standard values `http/json` (default),
286
+ * `http/protobuf`, or `grpc`; unknown values are rejected. The host language resolves the value
287
+ * (e.g. from `OTEL_EXPORTER_OTLP_TRACES_PROTOCOL`).
288
+ * The `grpc` protocol currently supports plaintext `http://` endpoints only.
289
+ *
290
+ * Has no effect unless an OTLP endpoint is also configured via
291
+ * `ddog_trace_exporter_config_set_otlp_endpoint`; without one, traces are sent to the
292
+ * Datadog agent and this protocol selection is ignored.
293
+ *
294
+ * Returns `None` on success, `ErrorCode::InvalidArgument` for a null config or an unaccepted
295
+ * value, and `ErrorCode::InvalidInput` for a non-UTF-8 string.
296
+ */
297
+ DDOG_TRACE_EXPORTER_DEPRECATED("Use ddog_trace_exporter_builder_set_otlp_protocol instead")
298
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_otlp_protocol(struct ddog_TraceExporterConfig *config,
299
+ ddog_CharSlice protocol);
300
+
301
+ /**
302
+ * Sets OTLP trace instrumentation scope metadata.
303
+ *
304
+ * Has no effect unless an OTLP endpoint is also configured via
305
+ * `ddog_trace_exporter_config_set_otlp_endpoint`; without one, traces are sent to the
306
+ * Datadog agent and this scope metadata is ignored.
307
+ */
308
+ DDOG_TRACE_EXPORTER_DEPRECATED("Use ddog_trace_exporter_builder_set_otlp_instrumentation_scope instead")
309
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_otlp_instrumentation_scope(struct ddog_TraceExporterConfig *config,
310
+ ddog_CharSlice name,
311
+ ddog_CharSlice version);
312
+
313
+ /**
314
+ * Sets the cardinality limit for client-side stats computation.
315
+ *
316
+ * When the number of distinct stats groups exceeds `limit`, additional groups are
317
+ * aggregated into a sentinel key instead of being tracked individually.
318
+ * This bounds memory usage when the trace population has very high cardinality.
319
+ *
320
+ * Has no effect unless stats computation is enabled via
321
+ * `ddog_trace_exporter_config_set_compute_stats`.
322
+ */
323
+ DDOG_TRACE_EXPORTER_DEPRECATED("Use ddog_trace_exporter_builder_set_stats_cardinality_limit instead")
324
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_stats_cardinality_limit(struct ddog_TraceExporterConfig *config,
325
+ struct ddog_CardinalityLimitConfig limits);
326
+
327
+ /**
328
+ * Returns a `CardinalityLimitConfig` with default values
329
+ */
330
+ DDOG_TRACE_EXPORTER_DEPRECATED("Use ddog_trace_exporter_builder_default_stats_cardinality_limit instead")
331
+ struct ddog_CardinalityLimitConfig ddog_trace_exporter_config_default_stats_cardinality_limit(void);
332
+
333
+ /**
334
+ * Enables agentless APM trace export and sets the intake URL and API key.
335
+ *
336
+ * When set, APM trace spans are sent directly to the Datadog HTTP intake in JSON format
337
+ * (`POST /v1/input`) instead of through the Datadog Agent. Agentless trace export is mutually
338
+ * exclusive with both an agent URL ([`ddog_trace_exporter_config_set_url`]) and an OTLP endpoint
339
+ * ([`ddog_trace_exporter_config_set_otlp_endpoint`]); combining either with this setter causes
340
+ * [`ddog_trace_exporter_new`] to return an error.
341
+ */
342
+ DDOG_TRACE_EXPORTER_DEPRECATED("Use ddog_trace_exporter_builder_set_agentless_endpoint instead")
343
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_agentless_endpoint(struct ddog_TraceExporterConfig *config,
344
+ ddog_CharSlice url,
345
+ ddog_CharSlice api_key);
346
+
347
+ /**
348
+ * Sets the request timeout (in milliseconds) used by the agentless intake transport.
349
+ *
350
+ * Defaults to 15 seconds when unset. Calling this without also setting an agentless endpoint
351
+ * causes [`ddog_trace_exporter_new`] to return an error.
352
+ */
353
+ DDOG_TRACE_EXPORTER_DEPRECATED("Use ddog_trace_exporter_builder_set_agentless_timeout instead")
354
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_agentless_timeout(struct ddog_TraceExporterConfig *config,
355
+ uint64_t timeout_ms);
356
+
357
+ /**
358
+ * Sets the span obfuscation configuration from a JSON string.
359
+ *
360
+ * `json` is deserialized into `ObfuscationConfig` (the same struct the Datadog Agent uses),
361
+ * which controls obfuscation of HTTP URLs, SQL resources, Redis/Valkey commands, memcached
362
+ * commands, credit-card numbers, elasticsearch/opensearch/mongodb bodies, and tag-replace
363
+ * rules. Obfuscation is applied to every span on the agentless export path (see
364
+ * [`ddog_trace_exporter_config_set_agentless_endpoint`]); it has no effect on the agent path.
365
+ *
366
+ * Returns an error if `json` is not valid UTF-8 or fails to deserialize. Example:
367
+ * ```c
368
+ * ddog_trace_exporter_config_set_obfuscation_config(
369
+ * cfg, DDOG_CHARSLICE_C(
370
+ * "{\"http\":{\"remove_query_string\":true},"
371
+ * "\"credit_cards\":{\"enabled\":true}}"));
372
+ * ```
373
+ */
374
+ DDOG_TRACE_EXPORTER_DEPRECATED("Use ddog_trace_exporter_builder_set_span_obfuscation_config instead")
375
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_obfuscation_config(struct ddog_TraceExporterConfig *config,
376
+ ddog_CharSlice json);
377
+
378
+ /**
379
+ * Configure the exporter to write traces as newline-delimited JSON to stdout (the Datadog
380
+ * Forwarder "log exporter" path) instead of sending them to a Datadog agent. Used in serverless
381
+ * environments (e.g. AWS Lambda) when no agent is reachable.
382
+ *
383
+ * `max_line_size` overrides the per-line byte cap; pass `0` to use the default (256 KiB, the AWS
384
+ * CloudWatch Logs limit). When enabled, agent-specific behavior (agent-info polling, client-side
385
+ * stats, V1 negotiation) is bypassed.
386
+ *
387
+ * In this mode each span's `meta` is serialized to process stdout (and thus captured by CloudWatch
388
+ * Logs in Lambda); `meta_struct` is excluded because it holds raw msgpack the log intake cannot
389
+ * interpret.
390
+ *
391
+ * Writes are synchronous/blocking on stdout, so this mode targets single-threaded / current-thread
392
+ * serverless runtimes (e.g. AWS Lambda) where a blocking write won't stall a shared async reactor.
393
+ */
394
+ DDOG_TRACE_EXPORTER_DEPRECATED("Use ddog_trace_exporter_builder_set_output_to_log instead")
395
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_output_to_log(struct ddog_TraceExporterConfig *config,
396
+ uintptr_t max_line_size);
397
+
398
+ /**
399
+ * Create a new TraceExporter instance.
400
+ *
401
+ * When an OTLP endpoint is configured via `TraceExporterConfig`, the exporter sends traces using
402
+ * the configured `http/json`, `http/protobuf`, or `grpc` protocol instead of the Datadog agent.
403
+ * The same payload (e.g. MessagePack) is passed to
404
+ * `ddog_trace_exporter_send`; the library decodes and converts it to OTLP when OTLP is enabled.
405
+ *
406
+ * # Arguments
407
+ *
408
+ * * `out_handle` - The handle to write the TraceExporter instance in.
409
+ * * `config` - The configuration used to set up the TraceExporter handle.
410
+ */
411
+ DDOG_TRACE_EXPORTER_DEPRECATED("Use ddog_trace_exporter_builder_build instead")
412
+ struct ddog_TraceExporterError *ddog_trace_exporter_new(ddog_TraceExporter **out_handle,
413
+ const struct ddog_TraceExporterConfig *config);
414
+
415
+ /**
416
+ * Free the TraceExporter instance.
417
+ *
418
+ * # Arguments
419
+ *
420
+ * * handle - The handle to the TraceExporter instance.
421
+ */
422
+ void ddog_trace_exporter_free(ddog_TraceExporter *handle);
423
+
424
+ /**
425
+ * Consumes the exporter and waits at most `timeout_ms` for its workers to flush.
426
+ * The handle is consumed on success and error. Other workers on a shared runtime
427
+ * are unaffected. The deadline bounds worker flushing, not runtime destruction:
428
+ * dropping the last runtime owner can additionally wait for blocking tasks such
429
+ * as system DNS resolution. Hosts must account for that separately.
430
+ *
431
+ * # Safety
432
+ *
433
+ * `handle` must be valid and must not be used concurrently or after this call.
434
+ */
435
+ struct ddog_TraceExporterError *ddog_trace_exporter_shutdown(ddog_TraceExporter *handle,
436
+ uint64_t timeout_ms);
437
+
438
+ /**
439
+ * Releases the exporter without flushing or stopping its workers.
440
+ * The caller must also dispose of the runtime that owns those workers. This is
441
+ * intended for finalisation and failed fork recovery with an exclusively owned runtime.
442
+ *
443
+ * # Safety
444
+ *
445
+ * `handle` must be valid and must not be used concurrently or after this call.
446
+ */
447
+ void ddog_trace_exporter_discard(ddog_TraceExporter *handle);
448
+
449
+ /**
450
+ * Send traces to the Datadog Agent.
451
+ *
452
+ * # Arguments
453
+ *
454
+ * * `handle` - The handle to the TraceExporter instance.
455
+ * * `trace` - The traces to send to the Datadog Agent in the input format used to create the
456
+ * TraceExporter. The memory for the trace must be valid for the life of the call to this
457
+ * function.
458
+ * * `trace_count` - The number of traces to send to the Datadog Agent.
459
+ * * `response_out` - Optional handle to store a pointer to the agent response information.
460
+ */
461
+ struct ddog_TraceExporterError *ddog_trace_exporter_send(const ddog_TraceExporter *handle,
462
+ ddog_ByteSlice trace,
463
+ struct ddog_TraceExporterResponse **response_out);
464
+
465
+ /**
466
+ * Creates a trace exporter builder. Free it with `ddog_trace_exporter_builder_free`, or
467
+ * transfer ownership to `ddog_trace_exporter_builder_build` (including on build failure).
468
+ */
469
+ void ddog_trace_exporter_builder_new(struct ddog_TraceExporterBuilder_ForkSafeRuntime **out_handle);
470
+
471
+ /**
472
+ * Frees a builder handle that has not been passed to `ddog_trace_exporter_builder_build`.
473
+ */
474
+ void ddog_trace_exporter_builder_free(struct ddog_TraceExporterBuilder_ForkSafeRuntime *handle);
475
+
476
+ /**
477
+ * Sets traces destination.
478
+ */
479
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_set_url(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder,
480
+ ddog_CharSlice url);
481
+
482
+ /**
483
+ * Sets tracer's version to be included in the headers request.
484
+ */
485
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_set_tracer_version(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder,
486
+ ddog_CharSlice version);
487
+
488
+ /**
489
+ * Sets tracer's language to be included in the headers request.
490
+ */
491
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_set_language(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder,
492
+ ddog_CharSlice lang);
493
+
494
+ /**
495
+ * Sets tracer's language version to be included in the headers request.
496
+ */
497
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_set_language_version(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder,
498
+ ddog_CharSlice version);
499
+
500
+ /**
501
+ * Sets tracer's language interpreter to be included in the headers request.
502
+ */
503
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_set_language_interpreter(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder,
504
+ ddog_CharSlice interpreter);
505
+
506
+ /**
507
+ * Sets hostname information to be included in the headers request.
508
+ */
509
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_set_hostname(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder,
510
+ ddog_CharSlice hostname);
511
+
512
+ /**
513
+ * Sets environment information to be included in the headers request.
514
+ */
515
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_set_env(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder,
516
+ ddog_CharSlice env);
517
+
518
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_set_app_version(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder,
519
+ ddog_CharSlice version);
520
+
521
+ /**
522
+ * Sets service name to be included in the headers request.
523
+ */
524
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_set_service(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder,
525
+ ddog_CharSlice service);
526
+
527
+ /**
528
+ * Enables health metrics emission.
529
+ */
530
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_enable_health_metrics(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder);
531
+
532
+ /**
533
+ * Enables telemetry metrics.
534
+ */
535
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_enable_telemetry(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder,
536
+ const struct ddog_ExporterTelemetryConfig *telemetry_cfg);
537
+
538
+ /**
539
+ * Sets optional instrumentation session headers on telemetry requests (`dd-session-id`,
540
+ * `dd-root-session-id`, `dd-parent-session-id`). Each slice is stored as given; an empty
541
+ * slice stores an empty session id.
542
+ *
543
+ * All three slices are validated before any value is applied: invalid UTF-8 in any of them
544
+ * returns an error and leaves the builder unchanged.
545
+ */
546
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_set_telemetry_instrumentation_sessions(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder,
547
+ ddog_CharSlice session_id,
548
+ ddog_CharSlice root_session_id,
549
+ ddog_CharSlice parent_session_id);
550
+
551
+ /**
552
+ * Enables client-side stats computation with the given bucket interval in seconds.
553
+ * Pass `10` to use the default 10-second bucket interval.
554
+ */
555
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_enable_stats(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder,
556
+ uint64_t bucket_interval_secs);
557
+
558
+ /**
559
+ * Sets `Datadog-Client-Computed-Stats` header to `true`.
560
+ * This indicates that the upstream system has already computed the stats,
561
+ * and no further stats computation should be performed.
562
+ *
563
+ * <div class="warning">
564
+ * This method must not be used with `ddog_trace_exporter_builder_enable_stats`, as it could
565
+ * result in duplicate stats computation.
566
+ * </div>
567
+ *
568
+ * A common use case is in Application Security Monitoring (ASM) scenarios:
569
+ * when APM is disabled but ASM is enabled, setting this header to `true`
570
+ * ensures that no stats are computed at any level (exporter or agent).
571
+ */
572
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_set_client_computed_stats(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder);
573
+
574
+ /**
575
+ * Shares a mutable metadata handle with the exporter builder.
576
+ *
577
+ * Replaces metadata previously set by `ddog_trace_exporter_builder_set_process_tags` and
578
+ * `ddog_trace_exporter_builder_set_runtime_id`. Calling those setters afterwards updates the
579
+ * shared handle.
580
+ */
581
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_set_mutable_metadata(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder,
582
+ const ddog_MutableMetadataHandle *metadata);
583
+
584
+ /**
585
+ * Sets the process tags to be included in the stats payload.
586
+ *
587
+ * This should not be used when `ddog_trace_exporter_builder_set_mutable_metadata` is used.
588
+ */
589
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_set_process_tags(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder,
590
+ ddog_CharSlice process_tags);
591
+
592
+ /**
593
+ * Sets the runtime id used in payloads.
594
+ *
595
+ * This should not be used when `ddog_trace_exporter_builder_set_mutable_metadata` is used.
596
+ */
597
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_set_runtime_id(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder,
598
+ ddog_CharSlice runtime_id);
599
+
600
+ /**
601
+ * Sets the `X-Datadog-Test-Session-Token` header. Only used for testing with the test agent.
602
+ */
603
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_set_test_session_token(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder,
604
+ ddog_CharSlice token);
605
+
606
+ /**
607
+ * Sets the timeout in ms for all agent's connections.
608
+ */
609
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_set_connection_timeout(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder,
610
+ uint64_t timeout_ms);
611
+
612
+ /**
613
+ * Sets a shared runtime for the TraceExporter to use for background workers.
614
+ *
615
+ * `handle` must have been initialized with [`ddog_shared_runtime_new`].
616
+ *
617
+ * When set, the exporter will use the provided runtime instead of creating its own.
618
+ * This allows multiple exporters (or other components) to share a single runtime.
619
+ * The builder holds a clone of the `Arc` (increments the strong count), so the
620
+ * original handle remains valid and must still be freed with
621
+ * [`ddog_shared_runtime_free`].
622
+ */
623
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_set_shared_runtime(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder,
624
+ struct ddog_ForkSafeRuntime *handle);
625
+
626
+ /**
627
+ * Enables OTLP trace export and sets the endpoint URL.
628
+ *
629
+ * When set, traces are sent to this URL using the protocol selected by
630
+ * `ddog_trace_exporter_builder_set_otlp_protocol` instead of the Datadog agent. The host language
631
+ * is responsible for resolving the endpoint from its configuration (e.g.
632
+ * `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT`) before calling this function.
633
+ */
634
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_set_otlp_endpoint(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder,
635
+ ddog_CharSlice url);
636
+
637
+ /**
638
+ * Sets the OTLP export protocol. Accepts the OTel-standard values `http/json` (default),
639
+ * `http/protobuf`, or `grpc`; unknown values are rejected. The host language resolves the value
640
+ * (e.g. from `OTEL_EXPORTER_OTLP_TRACES_PROTOCOL`).
641
+ * The `grpc` protocol currently supports plaintext `http://` endpoints only.
642
+ *
643
+ * Has no effect unless an OTLP endpoint is also configured via
644
+ * `ddog_trace_exporter_builder_set_otlp_endpoint`; without one, traces are sent to the
645
+ * Datadog agent and this protocol selection is ignored.
646
+ *
647
+ * Returns `None` on success, `ErrorCode::InvalidArgument` for a null builder or an unaccepted
648
+ * value, and `ErrorCode::InvalidInput` for a non-UTF-8 string.
649
+ */
650
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_set_otlp_protocol(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder,
651
+ ddog_CharSlice protocol);
652
+
653
+ /**
654
+ * Sets OTLP trace instrumentation scope metadata.
655
+ *
656
+ * Has no effect unless an OTLP endpoint is also configured via
657
+ * `ddog_trace_exporter_builder_set_otlp_endpoint`; without one, traces are sent to the
658
+ * Datadog agent and this scope metadata is ignored.
659
+ */
660
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_set_otlp_instrumentation_scope(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder,
661
+ ddog_CharSlice name,
662
+ ddog_CharSlice version);
663
+
664
+ /**
665
+ * Sets the cardinality limit for client-side stats computation.
666
+ *
667
+ * When the number of distinct stats groups exceeds `limit`, additional groups are
668
+ * aggregated into a sentinel key instead of being tracked individually.
669
+ * This bounds memory usage when the trace population has very high cardinality.
670
+ *
671
+ * Has no effect unless stats computation is enabled via
672
+ * `ddog_trace_exporter_builder_enable_stats`.
673
+ */
674
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_set_stats_cardinality_limit(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder,
675
+ struct ddog_CardinalityLimitConfig limits);
676
+
677
+ /**
678
+ * Returns a `CardinalityLimitConfig` with default values
679
+ */
680
+ struct ddog_CardinalityLimitConfig ddog_trace_exporter_builder_default_stats_cardinality_limit(void);
681
+
682
+ /**
683
+ * Enables agentless APM trace export and sets the intake URL and API key.
684
+ *
685
+ * When set, APM trace spans are sent directly to the Datadog HTTP intake in JSON format
686
+ * (`POST /v1/input`) instead of through the Datadog Agent. Agentless trace export is mutually
687
+ * exclusive with both an agent URL ([`ddog_trace_exporter_builder_set_url`]) and an OTLP endpoint
688
+ * ([`ddog_trace_exporter_builder_set_otlp_endpoint`]); combining either with this setter causes
689
+ * [`ddog_trace_exporter_builder_build`] to return an error.
690
+ */
691
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_set_agentless_endpoint(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder,
692
+ ddog_CharSlice url,
693
+ ddog_CharSlice api_key);
694
+
695
+ /**
696
+ * Sets the request timeout (in milliseconds) used by the agentless intake transport.
697
+ *
698
+ * Defaults to 15 seconds when unset. Calling this without also setting an agentless endpoint
699
+ * causes [`ddog_trace_exporter_builder_build`] to return an error.
700
+ */
701
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_set_agentless_timeout(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder,
702
+ uint64_t timeout_ms);
703
+
704
+ /**
705
+ * Sets the span obfuscation configuration from a JSON string.
706
+ *
707
+ * `json` is deserialized into `ObfuscationConfig` (the same struct the Datadog Agent uses),
708
+ * which controls obfuscation of HTTP URLs, SQL resources, Redis/Valkey commands, memcached
709
+ * commands, credit-card numbers, elasticsearch/opensearch/mongodb bodies, and tag-replace
710
+ * rules. Obfuscation is applied to every span on the agentless export path (see
711
+ * [`ddog_trace_exporter_builder_set_agentless_endpoint`]); it has no effect on the agent path.
712
+ *
713
+ * Returns an error if `json` is not valid UTF-8 or fails to deserialize. Example:
714
+ * ```c
715
+ * ddog_trace_exporter_builder_set_span_obfuscation_config(
716
+ * cfg, DDOG_CHARSLICE_C(
717
+ * "{\"http\":{\"remove_query_string\":true},"
718
+ * "\"credit_cards\":{\"enabled\":true}}"));
719
+ * ```
720
+ */
721
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_set_span_obfuscation_config(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder,
722
+ ddog_CharSlice json);
723
+
724
+ /**
725
+ * Set the URL to communicate with a dogstatsd server.
726
+ */
727
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_set_dogstatsd_url(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder,
728
+ ddog_CharSlice url);
729
+
730
+ /**
731
+ * Set the `Datadog-Meta-Git-Commit-Sha` header.
732
+ */
733
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_set_git_commit_sha(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder,
734
+ ddog_CharSlice git_commit_sha);
735
+
736
+ /**
737
+ * Set the `Datadog-Container-Id` header.
738
+ */
739
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_set_container_id(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder,
740
+ ddog_CharSlice container_id);
741
+
742
+ /**
743
+ * Set the `Datadog-Meta-Lang-Interpreter-Vendor` header.
744
+ */
745
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_set_language_interpreter_vendor(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder,
746
+ ddog_CharSlice lang_interpreter_vendor);
747
+
748
+ /**
749
+ * Set the input format of the trace payloads passed to `ddog_trace_exporter_send`.
750
+ */
751
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_set_input_format(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder,
752
+ enum ddog_TraceExporterInputFormat input_format);
753
+
754
+ /**
755
+ * Set the output format used to serialize traces.
756
+ */
757
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_set_output_format(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder,
758
+ enum ddog_TraceExporterOutputFormat output_format);
759
+
760
+ /**
761
+ * Opt in to the V1 trace protocol.
762
+ *
763
+ * V1 is only used after runtime negotiation with the agent via `/info`. When the agent does
764
+ * not advertise the `/v1.0/traces` endpoint, the exporter falls back to V0.4 transparently.
765
+ * V1 is only compatible with V0.4 input.
766
+ */
767
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_enable_v1_protocol(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder);
768
+
769
+ /**
770
+ * Set the header indicating the tracer has computed the top-level tag.
771
+ */
772
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_set_client_computed_top_level(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder);
773
+
774
+ /**
775
+ * Sets whether background workers spawned by this exporter are restarted in the child after
776
+ * the process `fork()`s. Defaults to `true`.
777
+ *
778
+ * Set to `false` if the trace exporter is recreated after the fork to avoid restarting workers
779
+ * which are going to be discarded anyway.
780
+ */
781
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_set_restart_after_fork(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder,
782
+ bool restart_after_fork);
783
+
784
+ /**
785
+ * Enables storing and checking the agent payload version used to detect agent rate updates.
786
+ */
787
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_enable_agent_rates_payload_version(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder);
788
+
789
+ /**
790
+ * Enables OpenTelemetry trace semantics when converting spans for OTLP export.
791
+ */
792
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_enable_otel_trace_semantics(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder);
793
+
794
+ /**
795
+ * Sets the OTLP metrics intake endpoint used to export OTLP metrics. No effect unless an
796
+ * OTLP endpoint is also configured via `ddog_trace_exporter_builder_set_otlp_endpoint`.
797
+ */
798
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_set_otlp_metrics_endpoint(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder,
799
+ ddog_CharSlice url);
800
+
801
+ /**
802
+ * Sets the tracer tags to include in requests.
803
+ */
804
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_set_tracer_tags(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder,
805
+ struct ddog_ExporterTagList tracer_tags);
806
+
807
+ /**
808
+ * Seeds the peer tags used for peer tags aggregation in stats computation (requires stats
809
+ * computation to be enabled).
810
+ */
811
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_set_peer_tags(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder,
812
+ struct ddog_ExporterTagList peer_tags);
813
+
814
+ /**
815
+ * Sets additional metric tag keys.
816
+ */
817
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_set_additional_metric_tag_keys(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder,
818
+ struct ddog_ExporterTagList tag_keys);
819
+
820
+ /**
821
+ * Sets additional headers or gRPC metadata to include in OTLP trace export requests.
822
+ *
823
+ * Headers should be provided as name/value pairs. The host language is responsible for
824
+ * resolving headers from its configuration (e.g. `OTEL_EXPORTER_OTLP_TRACES_HEADERS`)
825
+ * before calling this function.
826
+ */
827
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_set_otlp_headers(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder,
828
+ struct ddog_ExporterHeaderList headers);
829
+
830
+ /**
831
+ * Additional HTTP headers for OTLP trace-metrics requests.
832
+ */
833
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_set_otlp_metrics_headers(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder,
834
+ struct ddog_ExporterHeaderList headers);
835
+
836
+ /**
837
+ * Configure the exporter to write traces as newline-delimited JSON to stdout (the Datadog
838
+ * Forwarder "log exporter" path) instead of sending them to a Datadog agent. Used in serverless
839
+ * environments (e.g. AWS Lambda) when no agent is reachable.
840
+ *
841
+ * `max_line_size` overrides the per-line byte cap; pass `0` to use the default (256 KiB, the AWS
842
+ * CloudWatch Logs limit). When enabled, agent-specific behavior (agent-info polling, client-side
843
+ * stats, V1 negotiation) is bypassed.
844
+ *
845
+ * In this mode each span's `meta` is serialized to process stdout (and thus captured by CloudWatch
846
+ * Logs in Lambda); `meta_struct` is excluded because it holds raw msgpack the log intake cannot
847
+ * interpret.
848
+ *
849
+ * Writes are synchronous/blocking on stdout, so this mode targets single-threaded / current-thread
850
+ * serverless runtimes (e.g. AWS Lambda) where a blocking write won't stall a shared async reactor.
851
+ */
852
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_set_output_to_log(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder,
853
+ uintptr_t max_line_size);
854
+
855
+ /**
856
+ * Create a new TraceExporter instance.
857
+ *
858
+ * When an OTLP endpoint is configured via `TraceExporterBuilder<ForkSafeRuntime>`, the exporter
859
+ * sends traces using the configured `http/json`, `http/protobuf`, or `grpc` protocol instead of
860
+ * the Datadog agent. The same payload (e.g. MessagePack) is passed to
861
+ * `ddog_trace_exporter_send`; the library decodes and converts it to OTLP when OTLP is enabled.
862
+ *
863
+ * # Arguments
864
+ *
865
+ * * `out_handle` - The handle to write the TraceExporter instance in.
866
+ * * `builder` - The builder used to set up the TraceExporter handle. Ownership is transferred to
867
+ * this function even on failure; do not reuse or free it after this call.
868
+ */
869
+ struct ddog_TraceExporterError *ddog_trace_exporter_builder_build(struct ddog_TraceExporterBuilder_ForkSafeRuntime *builder,
870
+ ddog_TraceExporter **out_handle);
871
+
872
+ /**
873
+ * Create a new span with all scalar fields set.
874
+ *
875
+ * String fields are copied from the provided slices. The `meta`, `metrics` and `meta_struct`
876
+ * maps start empty; use [`ddog_tracer_span_set_meta`], [`ddog_tracer_span_set_metric`] and
877
+ * [`ddog_tracer_span_set_meta_struct_blob`] to populate them.
878
+ *
879
+ * Returns an error if `fields` is null, if any string field is not valid UTF-8, or if any of
880
+ * its slices is malformed.
881
+ *
882
+ * # Safety
883
+ *
884
+ * `out_handle` must point to valid, writable memory for a `Box<TracerSpan>`.
885
+ * All `CharSlice` fields in `fields` must point to valid memory for their
886
+ * stated length.
887
+ */
888
+ struct ddog_TraceExporterError *ddog_tracer_span_new(ddog_TracerSpan **out_handle,
889
+ const struct ddog_TracerSpanFields *fields);
890
+
891
+ /**
892
+ * Free a `TracerSpan` and all its contents.
893
+ *
894
+ * After this call the handle is invalid and must not be reused.
895
+ *
896
+ * # Safety
897
+ *
898
+ * `handle` must have been created by [`ddog_tracer_span_new`] and must not
899
+ * be used after this call.
900
+ */
901
+ void ddog_tracer_span_free(ddog_TracerSpan *handle);
902
+
903
+ /**
904
+ * Add or overwrite a string tag (`meta`) on the span.
905
+ *
906
+ * Both `key` and `value` are copied into the span.
907
+ *
908
+ * Returns an error if `handle` is null, if `key` or `value` is not valid UTF-8, or if either
909
+ * slice is malformed.
910
+ *
911
+ * # Safety
912
+ *
913
+ * `handle` must be a valid pointer to a `TracerSpan`. `key` and `value` must point to valid
914
+ * memory for their stated lengths.
915
+ */
916
+ struct ddog_TraceExporterError *ddog_tracer_span_set_meta(ddog_TracerSpan *handle,
917
+ ddog_CharSlice key,
918
+ ddog_CharSlice value);
919
+
920
+ /**
921
+ * Add or overwrite a numeric tag (`metric`) on the span.
922
+ *
923
+ * The `key` is copied into the span.
924
+ *
925
+ * Returns an error if `handle` is null, if `key` is not valid UTF-8, or if the slice is
926
+ * malformed.
927
+ *
928
+ * # Safety
929
+ *
930
+ * `handle` must be a valid pointer to a `TracerSpan`. `key` must point to valid memory for its
931
+ * stated length.
932
+ */
933
+ struct ddog_TraceExporterError *ddog_tracer_span_set_metric(ddog_TracerSpan *handle,
934
+ ddog_CharSlice key,
935
+ double value);
936
+
937
+ /**
938
+ * Add or overwrite a structured metadata entry (`meta_struct`) on the span.
939
+ *
940
+ * The `key` and opaque binary `value` are copied into the span. The value is
941
+ * not interpreted or validated as MessagePack.
942
+ *
943
+ * Returns an error if `handle` is null, if `key` is not valid UTF-8, or if either slice is
944
+ * malformed.
945
+ *
946
+ * # Safety
947
+ *
948
+ * `handle` must be a valid pointer to a `TracerSpan`. `key` and `value` must point to valid
949
+ * memory for their stated lengths.
950
+ */
951
+ struct ddog_TraceExporterError *ddog_tracer_span_set_meta_struct_blob(ddog_TracerSpan *handle,
952
+ ddog_CharSlice key,
953
+ ddog_ByteSlice value);
954
+
955
+ /**
956
+ * Encode and add or overwrite a structured metadata entry (`meta_struct`) on
957
+ * the span.
958
+ *
959
+ * The `key` is copied into the span. The structured-value tokens are fully
960
+ * validated and encoded directly into the span without exposing an
961
+ * intermediate blob to the caller. The span is unchanged on failure.
962
+ *
963
+ * # Safety
964
+ *
965
+ * `handle` must be a valid pointer to a `TracerSpan`. `key` must point to
966
+ * valid UTF-8 memory. `tokens` and every byte slice referenced by its tokens
967
+ * must remain valid for this call.
968
+ */
969
+ struct ddog_TraceExporterError *ddog_tracer_span_set_meta_struct(ddog_TracerSpan *handle,
970
+ ddog_CharSlice key,
971
+ struct ddog_Slice_TracerValueToken tokens);
972
+
973
+ /**
974
+ * Replace all span links in one atomic operation.
975
+ *
976
+ * The links, attributes, and strings are copied before this function returns.
977
+ * If any slice or string is invalid, the span's existing links are unchanged.
978
+ * Link order is preserved.
979
+ *
980
+ * # Safety
981
+ *
982
+ * `handle` must be a valid pointer to a `TracerSpan`. All slices must point to
983
+ * valid memory for their stated lengths.
984
+ */
985
+ struct ddog_TraceExporterError *ddog_tracer_span_set_links(ddog_TracerSpan *handle,
986
+ struct ddog_Slice_TracerSpanLink links);
987
+
988
+ /**
989
+ * Create an owned span event.
990
+ *
991
+ * The name is copied before this function returns. The event remains detached
992
+ * until consumed by [`ddog_tracer_span_add_event`].
993
+ */
994
+ struct ddog_TraceExporterError *ddog_tracer_span_event_new(ddog_TracerSpanEvent **out_handle,
995
+ ddog_CharSlice name,
996
+ uint64_t time_unix_nano);
997
+
998
+ /**
999
+ * Free a detached span event.
1000
+ */
1001
+ void ddog_tracer_span_event_free(ddog_TracerSpanEvent *handle);
1002
+
1003
+ /**
1004
+ * Add or overwrite a string event attribute. The key and value are copied.
1005
+ */
1006
+ struct ddog_TraceExporterError *ddog_tracer_span_event_set_string(ddog_TracerSpanEvent *event,
1007
+ ddog_CharSlice key,
1008
+ ddog_CharSlice value);
1009
+
1010
+ /**
1011
+ * Add or overwrite a boolean event attribute.
1012
+ */
1013
+ struct ddog_TraceExporterError *ddog_tracer_span_event_set_bool(ddog_TracerSpanEvent *event,
1014
+ ddog_CharSlice key,
1015
+ bool value);
1016
+
1017
+ /**
1018
+ * Add or overwrite a signed integer event attribute.
1019
+ */
1020
+ struct ddog_TraceExporterError *ddog_tracer_span_event_set_int(ddog_TracerSpanEvent *event,
1021
+ ddog_CharSlice key,
1022
+ int64_t value);
1023
+
1024
+ /**
1025
+ * Add or overwrite a double event attribute.
1026
+ */
1027
+ struct ddog_TraceExporterError *ddog_tracer_span_event_set_double(ddog_TracerSpanEvent *event,
1028
+ ddog_CharSlice key,
1029
+ double value);
1030
+
1031
+ /**
1032
+ * Add or overwrite a homogeneous string array event attribute.
1033
+ */
1034
+ struct ddog_TraceExporterError *ddog_tracer_span_event_set_string_array(ddog_TracerSpanEvent *event,
1035
+ ddog_CharSlice key,
1036
+ struct ddog_Slice_CharSlice values);
1037
+
1038
+ /**
1039
+ * Add or overwrite a homogeneous boolean array event attribute.
1040
+ */
1041
+ struct ddog_TraceExporterError *ddog_tracer_span_event_set_bool_array(ddog_TracerSpanEvent *event,
1042
+ ddog_CharSlice key,
1043
+ struct ddog_Slice_Bool values);
1044
+
1045
+ /**
1046
+ * Add or overwrite a homogeneous signed integer array event attribute.
1047
+ */
1048
+ struct ddog_TraceExporterError *ddog_tracer_span_event_set_int_array(ddog_TracerSpanEvent *event,
1049
+ ddog_CharSlice key,
1050
+ struct ddog_Slice_I64 values);
1051
+
1052
+ /**
1053
+ * Add or overwrite a homogeneous double array event attribute.
1054
+ */
1055
+ struct ddog_TraceExporterError *ddog_tracer_span_event_set_double_array(ddog_TracerSpanEvent *event,
1056
+ ddog_CharSlice key,
1057
+ struct ddog_Slice_F64 values);
1058
+
1059
+ /**
1060
+ * Atomically attach a completed event to a span, consuming the event.
1061
+ *
1062
+ * A non-null `event` is always consumed — moved into the span on success, or
1063
+ * dropped on any error (a null `span`, or an internal panic). Callers must not
1064
+ * use or free the event after this call. On error the span is unchanged.
1065
+ */
1066
+ struct ddog_TraceExporterError *ddog_tracer_span_add_event(ddog_TracerSpan *span,
1067
+ ddog_TracerSpanEvent *event);
1068
+
1069
+ /**
1070
+ * Create a new empty trace chunks container.
1071
+ *
1072
+ * `capacity` is a hint for the expected number of chunks; pass 0 if
1073
+ * unknown.
1074
+ *
1075
+ * # Safety
1076
+ *
1077
+ * `out_handle` must point to valid, writable memory for a
1078
+ * `Box<TracerTraceChunks>`.
1079
+ */
1080
+ struct ddog_TraceExporterError *ddog_tracer_trace_chunks_new(uintptr_t capacity,
1081
+ ddog_TracerTraceChunks **out_handle);
1082
+
1083
+ /**
1084
+ * Free a trace chunks container and all its contents.
1085
+ *
1086
+ * After this call the handle is invalid and must not be reused.
1087
+ *
1088
+ * # Safety
1089
+ *
1090
+ * `handle` must have been created by [`ddog_tracer_trace_chunks_new`].
1091
+ */
1092
+ void ddog_tracer_trace_chunks_free(ddog_TracerTraceChunks *handle);
1093
+
1094
+ /**
1095
+ * Start a new chunk (trace) inside the container.
1096
+ *
1097
+ * Subsequent [`ddog_tracer_trace_chunks_push_span`] calls will append
1098
+ * spans to this chunk until the next `begin_chunk` call.
1099
+ *
1100
+ * `capacity` is a hint for the expected number of spans in this chunk;
1101
+ * pass 0 if unknown.
1102
+ *
1103
+ * # Safety
1104
+ *
1105
+ * `handle` must be a valid pointer to a `TracerTraceChunks`.
1106
+ */
1107
+ struct ddog_TraceExporterError *ddog_tracer_trace_chunks_begin_chunk(ddog_TracerTraceChunks *handle,
1108
+ uintptr_t capacity);
1109
+
1110
+ /**
1111
+ * Move a span into the current (last) chunk, consuming the span handle.
1112
+ *
1113
+ * A chunk must have been started with
1114
+ * [`ddog_tracer_trace_chunks_begin_chunk`] before calling this function.
1115
+ *
1116
+ * # Safety
1117
+ *
1118
+ * * `handle` must be a valid pointer to a `TracerTraceChunks`.
1119
+ * * `span` is consumed and must not be used after this call.
1120
+ */
1121
+ struct ddog_TraceExporterError *ddog_tracer_trace_chunks_push_span(ddog_TracerTraceChunks *handle,
1122
+ ddog_TracerSpan *span);
1123
+
1124
+ /**
1125
+ * Create a new cancellation token.
1126
+ *
1127
+ * The returned token must be freed with
1128
+ * [`ddog_trace_exporter_cancel_token_drop`].
1129
+ */
1130
+ ddog_TraceExporterCancelToken *ddog_trace_exporter_cancel_token_new(void);
1131
+
1132
+ /**
1133
+ * Cancel a cancellation token.
1134
+ *
1135
+ * All clones of the same token observe the cancellation. Cancellation is cooperative and only
1136
+ * affects a [`ddog_trace_exporter_send_trace_chunks`] call that is in flight: that send stops
1137
+ * waiting for the agent at its next await point and fails with
1138
+ * [`ExporterErrorCode::IoError`], and the chunks it was sending may be lost.
1139
+ *
1140
+ * Cancelling while no send is using the token has no immediate effect. A send started later with
1141
+ * an already-cancelled token fails the same way without contacting the agent, and cancelling
1142
+ * after a send has finished does nothing.
1143
+ */
1144
+ void ddog_trace_exporter_cancel_token_cancel(const ddog_TraceExporterCancelToken *token);
1145
+
1146
+ /**
1147
+ * Free a cancellation token.
1148
+ *
1149
+ * After this call the token is invalid and must not be reused.
1150
+ */
1151
+ void ddog_trace_exporter_cancel_token_drop(ddog_TraceExporterCancelToken *token);
1152
+
1153
+ /**
1154
+ * Send trace chunks through a [`TraceExporter`], consuming the chunks.
1155
+ *
1156
+ * Computes stats, serializes in the configured output format, and sends to the agent with
1157
+ * retries.
1158
+ *
1159
+ * When `cancel` is non-null, cancelling that token aborts the in-flight request; see
1160
+ * [`ddog_trace_exporter_cancel_token_cancel`].
1161
+ *
1162
+ * On success, if `response_out` is non-null, a heap-allocated
1163
+ * [`ExporterResponse`] is written there. The caller owns it and must
1164
+ * free it with `ddog_trace_exporter_response_free`.
1165
+ *
1166
+ * # Safety
1167
+ *
1168
+ * * `chunks` is consumed and must not be used after this call.
1169
+ * * If `response_out` is non-null it must point to valid writable memory for a
1170
+ * `Box<ExporterResponse>`.
1171
+ */
1172
+ struct ddog_TraceExporterError *ddog_trace_exporter_send_trace_chunks(const ddog_TraceExporter *exporter,
1173
+ ddog_TracerTraceChunks *chunks,
1174
+ struct ddog_TraceExporterResponse **response_out,
1175
+ const ddog_TraceExporterCancelToken *cancel);
1176
+
1177
+ #ifdef __cplusplus
1178
+ } // extern "C"
1179
+ #endif // __cplusplus
1180
+
1181
+ #endif /* DDOG_DATA_PIPELINE_H */