libdatadog 44.0.1.1.0 → 45.0.0.1.0

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 +1 -1
  3. data/vendor/{libdatadog-44.0.1/aarch64-linux-musl → libdatadog-45.0.0/aarch64-linux}/LICENSE-3rdparty.csv +6 -9
  4. data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/aarch64-linux/bin/libdatadog-crashtracking-receiver +0 -0
  5. data/vendor/{libdatadog-44.0.1/x86_64-linux-musl → libdatadog-45.0.0/aarch64-linux}/include/datadog/common.h +168 -122
  6. data/vendor/{libdatadog-44.0.1/arm64-darwin → libdatadog-45.0.0/aarch64-linux}/include/datadog/data-pipeline.h +26 -0
  7. data/vendor/{libdatadog-44.0.1/aarch64-linux-musl → libdatadog-45.0.0/aarch64-linux}/include/datadog/library-config.h +47 -24
  8. data/vendor/{libdatadog-44.0.1/x86_64-linux-musl → libdatadog-45.0.0/aarch64-linux}/include/datadog/otel-thread-ctx.h +20 -6
  9. data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/aarch64-linux/lib/libdatadog_profiling.so +0 -0
  10. data/vendor/{libdatadog-44.0.1/arm64-darwin → libdatadog-45.0.0/aarch64-linux}/lib/pkgconfig/datadog_profiling_with_rpath.pc +1 -1
  11. data/vendor/{libdatadog-44.0.1/arm64-darwin → libdatadog-45.0.0/aarch64-linux-musl}/LICENSE-3rdparty.csv +6 -9
  12. data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/aarch64-linux-musl/bin/libdatadog-crashtracking-receiver +0 -0
  13. data/vendor/{libdatadog-44.0.1/arm64-darwin → libdatadog-45.0.0/aarch64-linux-musl}/include/datadog/common.h +168 -122
  14. data/vendor/{libdatadog-44.0.1/aarch64-linux → libdatadog-45.0.0/aarch64-linux-musl}/include/datadog/data-pipeline.h +26 -0
  15. data/vendor/{libdatadog-44.0.1/arm64-darwin → libdatadog-45.0.0/aarch64-linux-musl}/include/datadog/library-config.h +47 -24
  16. data/vendor/{libdatadog-44.0.1/arm64-darwin → libdatadog-45.0.0/aarch64-linux-musl}/include/datadog/otel-thread-ctx.h +20 -6
  17. data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/aarch64-linux-musl/lib/libdatadog_profiling.so +0 -0
  18. data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/aarch64-linux-musl/lib/pkgconfig/datadog_profiling_with_rpath.pc +1 -1
  19. data/vendor/{libdatadog-44.0.1/aarch64-linux → libdatadog-45.0.0/arm64-darwin}/LICENSE-3rdparty.csv +6 -9
  20. data/vendor/{libdatadog-44.0.1/aarch64-linux-musl → libdatadog-45.0.0/arm64-darwin}/include/datadog/common.h +168 -122
  21. data/vendor/{libdatadog-44.0.1/aarch64-linux-musl → libdatadog-45.0.0/arm64-darwin}/include/datadog/data-pipeline.h +26 -0
  22. data/vendor/{libdatadog-44.0.1/aarch64-linux → libdatadog-45.0.0/arm64-darwin}/include/datadog/library-config.h +47 -24
  23. data/vendor/{libdatadog-44.0.1/aarch64-linux → libdatadog-45.0.0/arm64-darwin}/include/datadog/otel-thread-ctx.h +20 -6
  24. data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/arm64-darwin/lib/libdatadog_profiling.dylib +0 -0
  25. data/vendor/{libdatadog-44.0.1/x86_64-linux-musl → libdatadog-45.0.0/arm64-darwin}/lib/pkgconfig/datadog_profiling_with_rpath.pc +1 -1
  26. data/vendor/libdatadog-45.0.0/x86_64-linux/LICENSE-3rdparty.csv +557 -0
  27. data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/x86_64-linux/bin/libdatadog-crashtracking-receiver +0 -0
  28. data/vendor/libdatadog-45.0.0/x86_64-linux/include/datadog/common.h +3169 -0
  29. data/vendor/libdatadog-45.0.0/x86_64-linux/include/datadog/data-pipeline.h +682 -0
  30. data/vendor/libdatadog-45.0.0/x86_64-linux/include/datadog/library-config.h +138 -0
  31. data/vendor/libdatadog-45.0.0/x86_64-linux/include/datadog/otel-thread-ctx.h +116 -0
  32. data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/x86_64-linux/lib/libdatadog_profiling.so +0 -0
  33. data/vendor/libdatadog-45.0.0/x86_64-linux/lib/pkgconfig/datadog_profiling_with_rpath.pc +15 -0
  34. data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/x86_64-linux-musl/LICENSE-3rdparty.csv +6 -9
  35. data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/x86_64-linux-musl/bin/libdatadog-crashtracking-receiver +0 -0
  36. data/vendor/{libdatadog-44.0.1/aarch64-linux → libdatadog-45.0.0/x86_64-linux-musl}/include/datadog/common.h +168 -122
  37. data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/x86_64-linux-musl/include/datadog/data-pipeline.h +26 -0
  38. data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/x86_64-linux-musl/include/datadog/library-config.h +47 -24
  39. data/vendor/{libdatadog-44.0.1/aarch64-linux-musl → libdatadog-45.0.0/x86_64-linux-musl}/include/datadog/otel-thread-ctx.h +20 -6
  40. data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/x86_64-linux-musl/lib/libdatadog_profiling.so +0 -0
  41. data/vendor/{libdatadog-44.0.1/aarch64-linux → libdatadog-45.0.0/x86_64-linux-musl}/lib/pkgconfig/datadog_profiling_with_rpath.pc +1 -1
  42. metadata +91 -91
  43. data/vendor/libdatadog-44.0.1/x86_64-linux/LICENSE-3rdparty.csv +0 -560
  44. data/vendor/libdatadog-44.0.1/x86_64-linux/include/datadog/common.h +0 -3123
  45. data/vendor/libdatadog-44.0.1/x86_64-linux/include/datadog/data-pipeline.h +0 -656
  46. data/vendor/libdatadog-44.0.1/x86_64-linux/include/datadog/library-config.h +0 -115
  47. data/vendor/libdatadog-44.0.1/x86_64-linux/include/datadog/otel-thread-ctx.h +0 -102
  48. data/vendor/libdatadog-44.0.1/x86_64-linux/lib/pkgconfig/datadog_profiling_with_rpath.pc +0 -15
  49. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/aarch64-linux/LICENSE +0 -0
  50. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/aarch64-linux/NOTICE +0 -0
  51. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/aarch64-linux/include/datadog/blazesym.h +0 -0
  52. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/aarch64-linux/include/datadog/crashtracker.h +0 -0
  53. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/aarch64-linux/include/datadog/ddsketch.h +0 -0
  54. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/aarch64-linux/include/datadog/ffe.h +0 -0
  55. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/aarch64-linux/include/datadog/log.h +0 -0
  56. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/aarch64-linux/include/datadog/profiling.h +0 -0
  57. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/aarch64-linux/include/datadog/shared-runtime.h +0 -0
  58. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/aarch64-linux/include/datadog/telemetry.h +0 -0
  59. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/aarch64-linux-musl/LICENSE +0 -0
  60. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/aarch64-linux-musl/NOTICE +0 -0
  61. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/aarch64-linux-musl/include/datadog/blazesym.h +0 -0
  62. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/aarch64-linux-musl/include/datadog/crashtracker.h +0 -0
  63. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/aarch64-linux-musl/include/datadog/ddsketch.h +0 -0
  64. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/aarch64-linux-musl/include/datadog/ffe.h +0 -0
  65. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/aarch64-linux-musl/include/datadog/log.h +0 -0
  66. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/aarch64-linux-musl/include/datadog/profiling.h +0 -0
  67. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/aarch64-linux-musl/include/datadog/shared-runtime.h +0 -0
  68. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/aarch64-linux-musl/include/datadog/telemetry.h +0 -0
  69. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/arm64-darwin/LICENSE +0 -0
  70. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/arm64-darwin/NOTICE +0 -0
  71. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/arm64-darwin/bin/libdatadog-crashtracking-receiver +0 -0
  72. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/arm64-darwin/include/datadog/blazesym.h +0 -0
  73. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/arm64-darwin/include/datadog/crashtracker.h +0 -0
  74. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/arm64-darwin/include/datadog/ddsketch.h +0 -0
  75. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/arm64-darwin/include/datadog/ffe.h +0 -0
  76. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/arm64-darwin/include/datadog/log.h +0 -0
  77. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/arm64-darwin/include/datadog/profiling.h +0 -0
  78. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/arm64-darwin/include/datadog/shared-runtime.h +0 -0
  79. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/arm64-darwin/include/datadog/telemetry.h +0 -0
  80. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/x86_64-linux/LICENSE +0 -0
  81. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/x86_64-linux/NOTICE +0 -0
  82. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/x86_64-linux/include/datadog/blazesym.h +0 -0
  83. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/x86_64-linux/include/datadog/crashtracker.h +0 -0
  84. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/x86_64-linux/include/datadog/ddsketch.h +0 -0
  85. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/x86_64-linux/include/datadog/ffe.h +0 -0
  86. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/x86_64-linux/include/datadog/log.h +0 -0
  87. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/x86_64-linux/include/datadog/profiling.h +0 -0
  88. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/x86_64-linux/include/datadog/shared-runtime.h +0 -0
  89. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/x86_64-linux/include/datadog/telemetry.h +0 -0
  90. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/x86_64-linux-musl/LICENSE +0 -0
  91. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/x86_64-linux-musl/NOTICE +0 -0
  92. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/x86_64-linux-musl/include/datadog/blazesym.h +0 -0
  93. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/x86_64-linux-musl/include/datadog/crashtracker.h +0 -0
  94. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/x86_64-linux-musl/include/datadog/ddsketch.h +0 -0
  95. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/x86_64-linux-musl/include/datadog/ffe.h +0 -0
  96. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/x86_64-linux-musl/include/datadog/log.h +0 -0
  97. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/x86_64-linux-musl/include/datadog/profiling.h +0 -0
  98. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/x86_64-linux-musl/include/datadog/shared-runtime.h +0 -0
  99. /data/vendor/{libdatadog-44.0.1 → libdatadog-45.0.0}/x86_64-linux-musl/include/datadog/telemetry.h +0 -0
@@ -0,0 +1,682 @@
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
+ #ifdef __cplusplus
14
+ extern "C" {
15
+ #endif // __cplusplus
16
+
17
+ /**
18
+ * Frees `error` and all its contents. After being called error will not point to a valid memory
19
+ * address so any further actions on it could lead to undefined behavior.
20
+ */
21
+ void ddog_trace_exporter_error_free(struct ddog_TraceExporterError *error);
22
+
23
+ /**
24
+ * Return a borrowed view of the response body. The returned slice is
25
+ * only valid as long as `response` is alive. Returns an empty slice
26
+ * when `response` is null or the body is absent.
27
+ */
28
+ ddog_ByteSlice ddog_trace_exporter_response_get_body(const struct ddog_TraceExporterResponse *response);
29
+
30
+ /**
31
+ * Free `response` and all its contents. After being called response will not point to a valid
32
+ * memory address so any further actions on it could lead to undefined behavior.
33
+ */
34
+ void ddog_trace_exporter_response_free(struct ddog_TraceExporterResponse *response);
35
+
36
+ /**
37
+ * Encode one flat preorder structured value as an owned MessagePack blob.
38
+ *
39
+ * On success, `out_handle` receives an owned blob that must be freed with
40
+ * [`ddog_tracer_encoded_value_free`]. The input is fully validated and must
41
+ * contain exactly one value. Token byte slices are borrowed only for this
42
+ * synchronous call; the returned blob does not retain them.
43
+ *
44
+ * # Safety
45
+ *
46
+ * `tokens` and every byte slice referenced by its tokens must remain valid for
47
+ * this call. `out_handle` must point to writable memory for a
48
+ * `Box<TracerEncodedValue>`.
49
+ */
50
+ struct ddog_TraceExporterError *ddog_tracer_encode_value(struct ddog_Slice_TracerValueToken tokens,
51
+ struct ddog_TracerEncodedValue **out_handle);
52
+
53
+ /**
54
+ * Borrow the bytes in an encoded value. The slice is valid until the blob is
55
+ * freed.
56
+ */
57
+ ddog_ByteSlice ddog_tracer_encoded_value_as_slice(const struct ddog_TracerEncodedValue *value);
58
+
59
+ /**
60
+ * Free an encoded structured value and its bytes.
61
+ */
62
+ void ddog_tracer_encoded_value_free(struct ddog_TracerEncodedValue *value);
63
+
64
+ void ddog_trace_exporter_config_new(struct ddog_TraceExporterConfig **out_handle);
65
+
66
+ /**
67
+ * Frees TraceExporterConfig handle internal resources.
68
+ */
69
+ void ddog_trace_exporter_config_free(struct ddog_TraceExporterConfig *handle);
70
+
71
+ /**
72
+ * Sets traces destination.
73
+ */
74
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_url(struct ddog_TraceExporterConfig *config,
75
+ ddog_CharSlice url);
76
+
77
+ /**
78
+ * Sets tracer's version to be included in the headers request.
79
+ */
80
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_tracer_version(struct ddog_TraceExporterConfig *config,
81
+ ddog_CharSlice version);
82
+
83
+ /**
84
+ * Sets tracer's language to be included in the headers request.
85
+ */
86
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_language(struct ddog_TraceExporterConfig *config,
87
+ ddog_CharSlice lang);
88
+
89
+ /**
90
+ * Sets tracer's language version to be included in the headers request.
91
+ */
92
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_lang_version(struct ddog_TraceExporterConfig *config,
93
+ ddog_CharSlice version);
94
+
95
+ /**
96
+ * Sets tracer's language interpreter to be included in the headers request.
97
+ */
98
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_lang_interpreter(struct ddog_TraceExporterConfig *config,
99
+ ddog_CharSlice interpreter);
100
+
101
+ /**
102
+ * Sets hostname information to be included in the headers request.
103
+ */
104
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_hostname(struct ddog_TraceExporterConfig *config,
105
+ ddog_CharSlice hostname);
106
+
107
+ /**
108
+ * Sets environment information to be included in the headers request.
109
+ */
110
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_env(struct ddog_TraceExporterConfig *config,
111
+ ddog_CharSlice env);
112
+
113
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_version(struct ddog_TraceExporterConfig *config,
114
+ ddog_CharSlice version);
115
+
116
+ /**
117
+ * Sets service name to be included in the headers request.
118
+ */
119
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_service(struct ddog_TraceExporterConfig *config,
120
+ ddog_CharSlice service);
121
+
122
+ /**
123
+ * Enables health metrics emission.
124
+ */
125
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_enable_health_metrics(struct ddog_TraceExporterConfig *config,
126
+ bool is_enabled);
127
+
128
+ /**
129
+ * Enables telemetry metrics.
130
+ */
131
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_enable_telemetry(struct ddog_TraceExporterConfig *config,
132
+ const struct ddog_TelemetryClientConfig *telemetry_cfg);
133
+
134
+ /**
135
+ * Set client-side stats computation status.
136
+ */
137
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_compute_stats(struct ddog_TraceExporterConfig *config,
138
+ bool is_enabled);
139
+
140
+ /**
141
+ * Indicates that the tracer has already marked top-level spans with `_dd.top_level`.
142
+ * Sets the `Datadog-Client-Computed-Top-Level` header without enabling stats computation.
143
+ */
144
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_client_computed_top_level(struct ddog_TraceExporterConfig *config,
145
+ bool client_computed_top_level);
146
+
147
+ /**
148
+ * Sets `Datadog-Client-Computed-Stats` header to `true`.
149
+ * This indicates that the upstream system has already computed the stats,
150
+ * and no further stats computation should be performed.
151
+ *
152
+ * <div class="warning">
153
+ * This method must not be used when `compute_stats` is enabled, as it could
154
+ * result in duplicate stats computation.
155
+ * </div>
156
+ *
157
+ * A common use case is in Application Security Monitoring (ASM) scenarios:
158
+ * when APM is disabled but ASM is enabled, setting this header to `true`
159
+ * ensures that no stats are computed at any level (exporter or agent).
160
+ */
161
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_client_computed_stats(struct ddog_TraceExporterConfig *config,
162
+ bool client_computed_stats);
163
+
164
+ /**
165
+ * Shares a mutable metadata handle with the exporter config.
166
+ *
167
+ * When set, this supersedes `ddog_trace_exporter_config_set_process_tags` and
168
+ * `ddog_trace_exporter_config_set_runtime_id`.
169
+ */
170
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_mutable_metadata(struct ddog_TraceExporterConfig *config,
171
+ const ddog_MutableMetadataHandle *metadata);
172
+
173
+ /**
174
+ * Sets the process tags to be included in the stats payload.
175
+ *
176
+ * This should not be used when `ddog_trace_exporter_config_set_mutable_metadata` is used.
177
+ */
178
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_process_tags(struct ddog_TraceExporterConfig *config,
179
+ ddog_CharSlice process_tags);
180
+
181
+ /**
182
+ * Sets the runtime id used in payloads.
183
+ *
184
+ * This should not be used when `ddog_trace_exporter_config_set_mutable_metadata` is used.
185
+ */
186
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_runtime_id(struct ddog_TraceExporterConfig *config,
187
+ ddog_CharSlice runtime_id);
188
+
189
+ /**
190
+ * Sets the `X-Datadog-Test-Session-Token` header. Only used for testing with the test agent.
191
+ */
192
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_test_session_token(struct ddog_TraceExporterConfig *config,
193
+ ddog_CharSlice token);
194
+
195
+ /**
196
+ * Sets the timeout in ms for all agent's connections.
197
+ */
198
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_connection_timeout(struct ddog_TraceExporterConfig *config,
199
+ uint64_t timeout_ms);
200
+
201
+ /**
202
+ * Sets a shared runtime for the TraceExporter to use for background workers.
203
+ *
204
+ * `handle` must have been initialized with [`ddog_shared_runtime_new`].
205
+ *
206
+ * When set, the exporter will use the provided runtime instead of creating its own.
207
+ * This allows multiple exporters (or other components) to share a single runtime.
208
+ * The config holds a clone of the `Arc` (increments the strong count), so the
209
+ * original handle remains valid and must still be freed with
210
+ * [`ddog_shared_runtime_free`].
211
+ */
212
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_shared_runtime(struct ddog_TraceExporterConfig *config,
213
+ struct ddog_ForkSafeRuntime *handle);
214
+
215
+ /**
216
+ * Enables OTLP trace export and sets the endpoint URL.
217
+ *
218
+ * When set, traces are sent to this URL using the protocol selected by
219
+ * `ddog_trace_exporter_config_set_otlp_protocol` instead of the Datadog agent. The host language
220
+ * is responsible for resolving the endpoint from its configuration (e.g.
221
+ * `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT`) before calling this function.
222
+ */
223
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_otlp_endpoint(struct ddog_TraceExporterConfig *config,
224
+ ddog_CharSlice url);
225
+
226
+ /**
227
+ * Sets the OTLP export protocol. Accepts the OTel-standard values `http/json` (default),
228
+ * `http/protobuf`, or `grpc`; unknown values are rejected. The host language resolves the value
229
+ * (e.g. from `OTEL_EXPORTER_OTLP_TRACES_PROTOCOL`).
230
+ * The `grpc` protocol currently supports plaintext `http://` endpoints only.
231
+ *
232
+ * Has no effect unless an OTLP endpoint is also configured via
233
+ * `ddog_trace_exporter_config_set_otlp_endpoint`; without one, traces are sent to the
234
+ * Datadog agent and this protocol selection is ignored.
235
+ *
236
+ * Returns `None` on success, `ErrorCode::InvalidArgument` for a null config or an unaccepted
237
+ * value, and `ErrorCode::InvalidInput` for a non-UTF-8 string.
238
+ */
239
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_otlp_protocol(struct ddog_TraceExporterConfig *config,
240
+ ddog_CharSlice protocol);
241
+
242
+ /**
243
+ * Sets OTLP trace instrumentation scope metadata.
244
+ *
245
+ * Has no effect unless an OTLP endpoint is also configured via
246
+ * `ddog_trace_exporter_config_set_otlp_endpoint`; without one, traces are sent to the
247
+ * Datadog agent and this scope metadata is ignored.
248
+ */
249
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_otlp_instrumentation_scope(struct ddog_TraceExporterConfig *config,
250
+ ddog_CharSlice name,
251
+ ddog_CharSlice version);
252
+
253
+ /**
254
+ * Sets the cardinality limit for client-side stats computation.
255
+ *
256
+ * When the number of distinct stats groups exceeds `limit`, additional groups are
257
+ * aggregated into a sentinel key instead of being tracked individually.
258
+ * This bounds memory usage when the trace population has very high cardinality.
259
+ *
260
+ * Has no effect unless stats computation is enabled via
261
+ * `ddog_trace_exporter_config_set_compute_stats`.
262
+ */
263
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_stats_cardinality_limit(struct ddog_TraceExporterConfig *config,
264
+ struct ddog_CardinalityLimitConfig limits);
265
+
266
+ /**
267
+ * Returns a `CardinalityLimitConfig` with default values
268
+ */
269
+ struct ddog_CardinalityLimitConfig ddog_trace_exporter_config_default_stats_cardinality_limit(void);
270
+
271
+ /**
272
+ * Enables agentless APM trace export and sets the intake URL and API key.
273
+ *
274
+ * When set, APM trace spans are sent directly to the Datadog HTTP intake in JSON format
275
+ * (`POST /v1/input`) instead of through the Datadog Agent. Agentless trace export is mutually
276
+ * exclusive with both an agent URL ([`ddog_trace_exporter_config_set_url`]) and an OTLP endpoint
277
+ * ([`ddog_trace_exporter_config_set_otlp_endpoint`]); combining either with this setter causes
278
+ * [`ddog_trace_exporter_new`] to return an error.
279
+ */
280
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_agentless_endpoint(struct ddog_TraceExporterConfig *config,
281
+ ddog_CharSlice url,
282
+ ddog_CharSlice api_key);
283
+
284
+ /**
285
+ * Sets the request timeout (in milliseconds) used by the agentless intake transport.
286
+ *
287
+ * Defaults to 15 seconds when unset. Calling this without also setting an agentless endpoint
288
+ * causes [`ddog_trace_exporter_new`] to return an error.
289
+ */
290
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_agentless_timeout(struct ddog_TraceExporterConfig *config,
291
+ uint64_t timeout_ms);
292
+
293
+ /**
294
+ * Sets the span obfuscation configuration from a JSON string.
295
+ *
296
+ * `json` is deserialized into `ObfuscationConfig` (the same struct the Datadog Agent uses),
297
+ * which controls obfuscation of HTTP URLs, SQL resources, Redis/Valkey commands, memcached
298
+ * commands, credit-card numbers, elasticsearch/opensearch/mongodb bodies, and tag-replace
299
+ * rules. Obfuscation is applied to every span on the agentless export path (see
300
+ * [`ddog_trace_exporter_config_set_agentless_endpoint`]); it has no effect on the agent path.
301
+ *
302
+ * Returns an error if `json` is not valid UTF-8 or fails to deserialize. Example:
303
+ * ```c
304
+ * ddog_trace_exporter_config_set_obfuscation_config(
305
+ * cfg, DDOG_CHARSLICE_C(
306
+ * "{\"http\":{\"remove_query_string\":true},"
307
+ * "\"credit_cards\":{\"enabled\":true}}"));
308
+ * ```
309
+ */
310
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_obfuscation_config(struct ddog_TraceExporterConfig *config,
311
+ ddog_CharSlice json);
312
+
313
+ /**
314
+ * Configure the exporter to write traces as newline-delimited JSON to stdout (the Datadog
315
+ * Forwarder "log exporter" path) instead of sending them to a Datadog agent. Used in serverless
316
+ * environments (e.g. AWS Lambda) when no agent is reachable.
317
+ *
318
+ * `max_line_size` overrides the per-line byte cap; pass `0` to use the default (256 KiB, the AWS
319
+ * CloudWatch Logs limit). When enabled, agent-specific behavior (agent-info polling, client-side
320
+ * stats, V1 negotiation) is bypassed.
321
+ *
322
+ * In this mode each span's `meta` is serialized to process stdout (and thus captured by CloudWatch
323
+ * Logs in Lambda); `meta_struct` is excluded because it holds raw msgpack the log intake cannot
324
+ * interpret.
325
+ *
326
+ * Writes are synchronous/blocking on stdout, so this mode targets single-threaded / current-thread
327
+ * serverless runtimes (e.g. AWS Lambda) where a blocking write won't stall a shared async reactor.
328
+ */
329
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_output_to_log(struct ddog_TraceExporterConfig *config,
330
+ uintptr_t max_line_size);
331
+
332
+ /**
333
+ * Create a new TraceExporter instance.
334
+ *
335
+ * When an OTLP endpoint is configured via `TraceExporterConfig`, the exporter sends traces using
336
+ * the configured `http/json`, `http/protobuf`, or `grpc` protocol instead of the Datadog agent.
337
+ * The same payload (e.g. MessagePack) is passed to
338
+ * `ddog_trace_exporter_send`; the library decodes and converts it to OTLP when OTLP is enabled.
339
+ *
340
+ * # Arguments
341
+ *
342
+ * * `out_handle` - The handle to write the TraceExporter instance in.
343
+ * * `config` - The configuration used to set up the TraceExporter handle.
344
+ */
345
+ struct ddog_TraceExporterError *ddog_trace_exporter_new(ddog_TraceExporter **out_handle,
346
+ const struct ddog_TraceExporterConfig *config);
347
+
348
+ /**
349
+ * Free the TraceExporter instance.
350
+ *
351
+ * # Arguments
352
+ *
353
+ * * handle - The handle to the TraceExporter instance.
354
+ */
355
+ void ddog_trace_exporter_free(ddog_TraceExporter *handle);
356
+
357
+ /**
358
+ * Send traces to the Datadog Agent.
359
+ *
360
+ * # Arguments
361
+ *
362
+ * * `handle` - The handle to the TraceExporter instance.
363
+ * * `trace` - The traces to send to the Datadog Agent in the input format used to create the
364
+ * TraceExporter. The memory for the trace must be valid for the life of the call to this
365
+ * function.
366
+ * * `trace_count` - The number of traces to send to the Datadog Agent.
367
+ * * `response_out` - Optional handle to store a pointer to the agent response information.
368
+ */
369
+ struct ddog_TraceExporterError *ddog_trace_exporter_send(const ddog_TraceExporter *handle,
370
+ ddog_ByteSlice trace,
371
+ struct ddog_TraceExporterResponse **response_out);
372
+
373
+ /**
374
+ * Create a new span with all scalar fields set.
375
+ *
376
+ * String fields are copied from the provided slices. The `meta`, `metrics` and `meta_struct`
377
+ * maps start empty; use [`ddog_tracer_span_set_meta`], [`ddog_tracer_span_set_metric`] and
378
+ * [`ddog_tracer_span_set_meta_struct_blob`] to populate them.
379
+ *
380
+ * Returns an error if `fields` is null, if any string field is not valid UTF-8, or if any of
381
+ * its slices is malformed.
382
+ *
383
+ * # Safety
384
+ *
385
+ * `out_handle` must point to valid, writable memory for a `Box<TracerSpan>`.
386
+ * All `CharSlice` fields in `fields` must point to valid memory for their
387
+ * stated length.
388
+ */
389
+ struct ddog_TraceExporterError *ddog_tracer_span_new(ddog_TracerSpan **out_handle,
390
+ const struct ddog_TracerSpanFields *fields);
391
+
392
+ /**
393
+ * Free a `TracerSpan` and all its contents.
394
+ *
395
+ * After this call the handle is invalid and must not be reused.
396
+ *
397
+ * # Safety
398
+ *
399
+ * `handle` must have been created by [`ddog_tracer_span_new`] and must not
400
+ * be used after this call.
401
+ */
402
+ void ddog_tracer_span_free(ddog_TracerSpan *handle);
403
+
404
+ /**
405
+ * Add or overwrite a string tag (`meta`) on the span.
406
+ *
407
+ * Both `key` and `value` are copied into the span.
408
+ *
409
+ * Returns an error if `handle` is null, if `key` or `value` is not valid UTF-8, or if either
410
+ * slice is malformed.
411
+ *
412
+ * # Safety
413
+ *
414
+ * `handle` must be a valid pointer to a `TracerSpan`. `key` and `value` must point to valid
415
+ * memory for their stated lengths.
416
+ */
417
+ struct ddog_TraceExporterError *ddog_tracer_span_set_meta(ddog_TracerSpan *handle,
418
+ ddog_CharSlice key,
419
+ ddog_CharSlice value);
420
+
421
+ /**
422
+ * Add or overwrite a numeric tag (`metric`) on the span.
423
+ *
424
+ * The `key` is copied into the span.
425
+ *
426
+ * Returns an error if `handle` is null, if `key` is not valid UTF-8, or if the slice is
427
+ * malformed.
428
+ *
429
+ * # Safety
430
+ *
431
+ * `handle` must be a valid pointer to a `TracerSpan`. `key` must point to valid memory for its
432
+ * stated length.
433
+ */
434
+ struct ddog_TraceExporterError *ddog_tracer_span_set_metric(ddog_TracerSpan *handle,
435
+ ddog_CharSlice key,
436
+ double value);
437
+
438
+ /**
439
+ * Add or overwrite a structured metadata entry (`meta_struct`) on the span.
440
+ *
441
+ * The `key` and opaque binary `value` are copied into the span. The value is
442
+ * not interpreted or validated as MessagePack.
443
+ *
444
+ * Returns an error if `handle` is null, if `key` is not valid UTF-8, or if either slice is
445
+ * malformed.
446
+ *
447
+ * # Safety
448
+ *
449
+ * `handle` must be a valid pointer to a `TracerSpan`. `key` and `value` must point to valid
450
+ * memory for their stated lengths.
451
+ */
452
+ struct ddog_TraceExporterError *ddog_tracer_span_set_meta_struct_blob(ddog_TracerSpan *handle,
453
+ ddog_CharSlice key,
454
+ ddog_ByteSlice value);
455
+
456
+ /**
457
+ * Encode and add or overwrite a structured metadata entry (`meta_struct`) on
458
+ * the span.
459
+ *
460
+ * The `key` is copied into the span. The structured-value tokens are fully
461
+ * validated and encoded directly into the span without exposing an
462
+ * intermediate blob to the caller. The span is unchanged on failure.
463
+ *
464
+ * # Safety
465
+ *
466
+ * `handle` must be a valid pointer to a `TracerSpan`. `key` must point to
467
+ * valid UTF-8 memory. `tokens` and every byte slice referenced by its tokens
468
+ * must remain valid for this call.
469
+ */
470
+ struct ddog_TraceExporterError *ddog_tracer_span_set_meta_struct(ddog_TracerSpan *handle,
471
+ ddog_CharSlice key,
472
+ struct ddog_Slice_TracerValueToken tokens);
473
+
474
+ /**
475
+ * Replace all span links in one atomic operation.
476
+ *
477
+ * The links, attributes, and strings are copied before this function returns.
478
+ * If any slice or string is invalid, the span's existing links are unchanged.
479
+ * Link order is preserved.
480
+ *
481
+ * # Safety
482
+ *
483
+ * `handle` must be a valid pointer to a `TracerSpan`. All slices must point to
484
+ * valid memory for their stated lengths.
485
+ */
486
+ struct ddog_TraceExporterError *ddog_tracer_span_set_links(ddog_TracerSpan *handle,
487
+ struct ddog_Slice_TracerSpanLink links);
488
+
489
+ /**
490
+ * Create an owned span event.
491
+ *
492
+ * The name is copied before this function returns. The event remains detached
493
+ * until consumed by [`ddog_tracer_span_add_event`].
494
+ */
495
+ struct ddog_TraceExporterError *ddog_tracer_span_event_new(ddog_TracerSpanEvent **out_handle,
496
+ ddog_CharSlice name,
497
+ uint64_t time_unix_nano);
498
+
499
+ /**
500
+ * Free a detached span event.
501
+ */
502
+ void ddog_tracer_span_event_free(ddog_TracerSpanEvent *handle);
503
+
504
+ /**
505
+ * Add or overwrite a string event attribute. The key and value are copied.
506
+ */
507
+ struct ddog_TraceExporterError *ddog_tracer_span_event_set_string(ddog_TracerSpanEvent *event,
508
+ ddog_CharSlice key,
509
+ ddog_CharSlice value);
510
+
511
+ /**
512
+ * Add or overwrite a boolean event attribute.
513
+ */
514
+ struct ddog_TraceExporterError *ddog_tracer_span_event_set_bool(ddog_TracerSpanEvent *event,
515
+ ddog_CharSlice key,
516
+ bool value);
517
+
518
+ /**
519
+ * Add or overwrite a signed integer event attribute.
520
+ */
521
+ struct ddog_TraceExporterError *ddog_tracer_span_event_set_int(ddog_TracerSpanEvent *event,
522
+ ddog_CharSlice key,
523
+ int64_t value);
524
+
525
+ /**
526
+ * Add or overwrite a double event attribute.
527
+ */
528
+ struct ddog_TraceExporterError *ddog_tracer_span_event_set_double(ddog_TracerSpanEvent *event,
529
+ ddog_CharSlice key,
530
+ double value);
531
+
532
+ /**
533
+ * Add or overwrite a homogeneous string array event attribute.
534
+ */
535
+ struct ddog_TraceExporterError *ddog_tracer_span_event_set_string_array(ddog_TracerSpanEvent *event,
536
+ ddog_CharSlice key,
537
+ struct ddog_Slice_CharSlice values);
538
+
539
+ /**
540
+ * Add or overwrite a homogeneous boolean array event attribute.
541
+ */
542
+ struct ddog_TraceExporterError *ddog_tracer_span_event_set_bool_array(ddog_TracerSpanEvent *event,
543
+ ddog_CharSlice key,
544
+ struct ddog_Slice_Bool values);
545
+
546
+ /**
547
+ * Add or overwrite a homogeneous signed integer array event attribute.
548
+ */
549
+ struct ddog_TraceExporterError *ddog_tracer_span_event_set_int_array(ddog_TracerSpanEvent *event,
550
+ ddog_CharSlice key,
551
+ struct ddog_Slice_I64 values);
552
+
553
+ /**
554
+ * Add or overwrite a homogeneous double array event attribute.
555
+ */
556
+ struct ddog_TraceExporterError *ddog_tracer_span_event_set_double_array(ddog_TracerSpanEvent *event,
557
+ ddog_CharSlice key,
558
+ struct ddog_Slice_F64 values);
559
+
560
+ /**
561
+ * Atomically attach a completed event to a span, consuming the event.
562
+ *
563
+ * A non-null `event` is always consumed — moved into the span on success, or
564
+ * dropped on any error (a null `span`, or an internal panic). Callers must not
565
+ * use or free the event after this call. On error the span is unchanged.
566
+ */
567
+ struct ddog_TraceExporterError *ddog_tracer_span_add_event(ddog_TracerSpan *span,
568
+ ddog_TracerSpanEvent *event);
569
+
570
+ /**
571
+ * Create a new empty trace chunks container.
572
+ *
573
+ * `capacity` is a hint for the expected number of chunks; pass 0 if
574
+ * unknown.
575
+ *
576
+ * # Safety
577
+ *
578
+ * `out_handle` must point to valid, writable memory for a
579
+ * `Box<TracerTraceChunks>`.
580
+ */
581
+ struct ddog_TraceExporterError *ddog_tracer_trace_chunks_new(uintptr_t capacity,
582
+ ddog_TracerTraceChunks **out_handle);
583
+
584
+ /**
585
+ * Free a trace chunks container and all its contents.
586
+ *
587
+ * After this call the handle is invalid and must not be reused.
588
+ *
589
+ * # Safety
590
+ *
591
+ * `handle` must have been created by [`ddog_tracer_trace_chunks_new`].
592
+ */
593
+ void ddog_tracer_trace_chunks_free(ddog_TracerTraceChunks *handle);
594
+
595
+ /**
596
+ * Start a new chunk (trace) inside the container.
597
+ *
598
+ * Subsequent [`ddog_tracer_trace_chunks_push_span`] calls will append
599
+ * spans to this chunk until the next `begin_chunk` call.
600
+ *
601
+ * `capacity` is a hint for the expected number of spans in this chunk;
602
+ * pass 0 if unknown.
603
+ *
604
+ * # Safety
605
+ *
606
+ * `handle` must be a valid pointer to a `TracerTraceChunks`.
607
+ */
608
+ struct ddog_TraceExporterError *ddog_tracer_trace_chunks_begin_chunk(ddog_TracerTraceChunks *handle,
609
+ uintptr_t capacity);
610
+
611
+ /**
612
+ * Move a span into the current (last) chunk, consuming the span handle.
613
+ *
614
+ * A chunk must have been started with
615
+ * [`ddog_tracer_trace_chunks_begin_chunk`] before calling this function.
616
+ *
617
+ * # Safety
618
+ *
619
+ * * `handle` must be a valid pointer to a `TracerTraceChunks`.
620
+ * * `span` is consumed and must not be used after this call.
621
+ */
622
+ struct ddog_TraceExporterError *ddog_tracer_trace_chunks_push_span(ddog_TracerTraceChunks *handle,
623
+ ddog_TracerSpan *span);
624
+
625
+ /**
626
+ * Create a new cancellation token.
627
+ *
628
+ * The returned token must be freed with
629
+ * [`ddog_trace_exporter_cancel_token_drop`].
630
+ */
631
+ ddog_TraceExporterCancelToken *ddog_trace_exporter_cancel_token_new(void);
632
+
633
+ /**
634
+ * Cancel a cancellation token.
635
+ *
636
+ * All clones of the same token observe the cancellation. Cancellation is cooperative and only
637
+ * affects a [`ddog_trace_exporter_send_trace_chunks`] call that is in flight: that send stops
638
+ * waiting for the agent at its next await point and fails with
639
+ * [`ExporterErrorCode::IoError`], and the chunks it was sending may be lost.
640
+ *
641
+ * Cancelling while no send is using the token has no immediate effect. A send started later with
642
+ * an already-cancelled token fails the same way without contacting the agent, and cancelling
643
+ * after a send has finished does nothing.
644
+ */
645
+ void ddog_trace_exporter_cancel_token_cancel(const ddog_TraceExporterCancelToken *token);
646
+
647
+ /**
648
+ * Free a cancellation token.
649
+ *
650
+ * After this call the token is invalid and must not be reused.
651
+ */
652
+ void ddog_trace_exporter_cancel_token_drop(ddog_TraceExporterCancelToken *token);
653
+
654
+ /**
655
+ * Send trace chunks through a [`TraceExporter`], consuming the chunks.
656
+ *
657
+ * Computes stats, serializes in the configured output format, and sends to the agent with
658
+ * retries.
659
+ *
660
+ * When `cancel` is non-null, cancelling that token aborts the in-flight request; see
661
+ * [`ddog_trace_exporter_cancel_token_cancel`].
662
+ *
663
+ * On success, if `response_out` is non-null, a heap-allocated
664
+ * [`ExporterResponse`] is written there. The caller owns it and must
665
+ * free it with `ddog_trace_exporter_response_free`.
666
+ *
667
+ * # Safety
668
+ *
669
+ * * `chunks` is consumed and must not be used after this call.
670
+ * * If `response_out` is non-null it must point to valid writable memory for a
671
+ * `Box<ExporterResponse>`.
672
+ */
673
+ struct ddog_TraceExporterError *ddog_trace_exporter_send_trace_chunks(const ddog_TraceExporter *exporter,
674
+ ddog_TracerTraceChunks *chunks,
675
+ struct ddog_TraceExporterResponse **response_out,
676
+ const ddog_TraceExporterCancelToken *cancel);
677
+
678
+ #ifdef __cplusplus
679
+ } // extern "C"
680
+ #endif // __cplusplus
681
+
682
+ #endif /* DDOG_DATA_PIPELINE_H */