libdatadog 36.0.0.1.0 → 37.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 (97) hide show
  1. checksums.yaml +4 -4
  2. data/lib/libdatadog/version.rb +1 -1
  3. data/tasks/build.rake +27 -1
  4. data/tasks/gem.rake +0 -4
  5. data/tasks/release.rake +28 -0
  6. data/tasks/spec.rake +11 -0
  7. data/vendor/{libdatadog-36.0.0/aarch64-linux-musl → libdatadog-37.0.0/aarch64-linux}/LICENSE-3rdparty.csv +1 -0
  8. data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/aarch64-linux/bin/libdatadog-crashtracking-receiver +0 -0
  9. data/vendor/{libdatadog-36.0.0/x86_64-linux-musl → libdatadog-37.0.0/aarch64-linux}/include/datadog/common.h +7 -14
  10. data/vendor/{libdatadog-36.0.0/aarch64-linux-musl → libdatadog-37.0.0/aarch64-linux}/include/datadog/data-pipeline.h +39 -5
  11. data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/aarch64-linux/include/datadog/shared-runtime.h +8 -8
  12. data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/aarch64-linux/lib/libdatadog_profiling.so +0 -0
  13. data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/aarch64-linux/lib/pkgconfig/datadog_profiling_with_rpath.pc +1 -1
  14. data/vendor/{libdatadog-36.0.0/aarch64-linux → libdatadog-37.0.0/aarch64-linux-musl}/LICENSE-3rdparty.csv +1 -0
  15. data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/aarch64-linux-musl/bin/libdatadog-crashtracking-receiver +0 -0
  16. data/vendor/{libdatadog-36.0.0/arm64-darwin → libdatadog-37.0.0/aarch64-linux-musl}/include/datadog/common.h +7 -14
  17. data/vendor/{libdatadog-36.0.0/aarch64-linux → libdatadog-37.0.0/aarch64-linux-musl}/include/datadog/data-pipeline.h +39 -5
  18. data/vendor/{libdatadog-36.0.0/arm64-darwin → libdatadog-37.0.0/aarch64-linux-musl}/include/datadog/shared-runtime.h +8 -8
  19. data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/aarch64-linux-musl/lib/libdatadog_profiling.so +0 -0
  20. data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/aarch64-linux-musl/lib/pkgconfig/datadog_profiling_with_rpath.pc +1 -1
  21. data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/arm64-darwin/LICENSE-3rdparty.csv +1 -0
  22. data/vendor/{libdatadog-36.0.0/aarch64-linux-musl → libdatadog-37.0.0/arm64-darwin}/include/datadog/common.h +7 -14
  23. data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/arm64-darwin/include/datadog/data-pipeline.h +39 -5
  24. data/vendor/{libdatadog-36.0.0/x86_64-linux-musl → libdatadog-37.0.0/arm64-darwin}/include/datadog/shared-runtime.h +8 -8
  25. data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/arm64-darwin/lib/libdatadog_profiling.dylib +0 -0
  26. data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/arm64-darwin/lib/pkgconfig/datadog_profiling_with_rpath.pc +1 -1
  27. data/vendor/libdatadog-37.0.0/x86_64-linux/LICENSE-3rdparty.csv +552 -0
  28. data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/x86_64-linux/bin/libdatadog-crashtracking-receiver +0 -0
  29. data/vendor/libdatadog-37.0.0/x86_64-linux/include/datadog/common.h +2940 -0
  30. data/vendor/libdatadog-37.0.0/x86_64-linux/include/datadog/data-pipeline.h +425 -0
  31. data/vendor/libdatadog-37.0.0/x86_64-linux/include/datadog/shared-runtime.h +91 -0
  32. data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/x86_64-linux/lib/libdatadog_profiling.so +0 -0
  33. data/vendor/libdatadog-37.0.0/x86_64-linux/lib/pkgconfig/datadog_profiling_with_rpath.pc +15 -0
  34. data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/x86_64-linux-musl/LICENSE-3rdparty.csv +1 -0
  35. data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/x86_64-linux-musl/bin/libdatadog-crashtracking-receiver +0 -0
  36. data/vendor/{libdatadog-36.0.0/aarch64-linux → libdatadog-37.0.0/x86_64-linux-musl}/include/datadog/common.h +7 -14
  37. data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/x86_64-linux-musl/include/datadog/data-pipeline.h +39 -5
  38. data/vendor/{libdatadog-36.0.0/aarch64-linux-musl → libdatadog-37.0.0/x86_64-linux-musl}/include/datadog/shared-runtime.h +8 -8
  39. data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/x86_64-linux-musl/lib/libdatadog_profiling.so +0 -0
  40. data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/x86_64-linux-musl/lib/pkgconfig/datadog_profiling_with_rpath.pc +1 -1
  41. metadata +88 -86
  42. data/vendor/libdatadog-36.0.0/x86_64-linux/LICENSE-3rdparty.csv +0 -551
  43. data/vendor/libdatadog-36.0.0/x86_64-linux/include/datadog/common.h +0 -2947
  44. data/vendor/libdatadog-36.0.0/x86_64-linux/include/datadog/data-pipeline.h +0 -391
  45. data/vendor/libdatadog-36.0.0/x86_64-linux/include/datadog/shared-runtime.h +0 -91
  46. data/vendor/libdatadog-36.0.0/x86_64-linux/lib/pkgconfig/datadog_profiling_with_rpath.pc +0 -15
  47. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/aarch64-linux/LICENSE +0 -0
  48. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/aarch64-linux/NOTICE +0 -0
  49. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/aarch64-linux/include/datadog/blazesym.h +0 -0
  50. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/aarch64-linux/include/datadog/crashtracker.h +0 -0
  51. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/aarch64-linux/include/datadog/ddsketch.h +0 -0
  52. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/aarch64-linux/include/datadog/ffe.h +0 -0
  53. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/aarch64-linux/include/datadog/library-config.h +0 -0
  54. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/aarch64-linux/include/datadog/log.h +0 -0
  55. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/aarch64-linux/include/datadog/profiling.h +0 -0
  56. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/aarch64-linux/include/datadog/telemetry.h +0 -0
  57. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/aarch64-linux-musl/LICENSE +0 -0
  58. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/aarch64-linux-musl/NOTICE +0 -0
  59. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/aarch64-linux-musl/include/datadog/blazesym.h +0 -0
  60. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/aarch64-linux-musl/include/datadog/crashtracker.h +0 -0
  61. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/aarch64-linux-musl/include/datadog/ddsketch.h +0 -0
  62. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/aarch64-linux-musl/include/datadog/ffe.h +0 -0
  63. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/aarch64-linux-musl/include/datadog/library-config.h +0 -0
  64. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/aarch64-linux-musl/include/datadog/log.h +0 -0
  65. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/aarch64-linux-musl/include/datadog/profiling.h +0 -0
  66. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/aarch64-linux-musl/include/datadog/telemetry.h +0 -0
  67. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/arm64-darwin/LICENSE +0 -0
  68. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/arm64-darwin/NOTICE +0 -0
  69. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/arm64-darwin/bin/libdatadog-crashtracking-receiver +0 -0
  70. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/arm64-darwin/include/datadog/blazesym.h +0 -0
  71. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/arm64-darwin/include/datadog/crashtracker.h +0 -0
  72. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/arm64-darwin/include/datadog/ddsketch.h +0 -0
  73. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/arm64-darwin/include/datadog/ffe.h +0 -0
  74. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/arm64-darwin/include/datadog/library-config.h +0 -0
  75. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/arm64-darwin/include/datadog/log.h +0 -0
  76. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/arm64-darwin/include/datadog/profiling.h +0 -0
  77. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/arm64-darwin/include/datadog/telemetry.h +0 -0
  78. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/x86_64-linux/LICENSE +0 -0
  79. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/x86_64-linux/NOTICE +0 -0
  80. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/x86_64-linux/include/datadog/blazesym.h +0 -0
  81. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/x86_64-linux/include/datadog/crashtracker.h +0 -0
  82. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/x86_64-linux/include/datadog/ddsketch.h +0 -0
  83. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/x86_64-linux/include/datadog/ffe.h +0 -0
  84. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/x86_64-linux/include/datadog/library-config.h +0 -0
  85. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/x86_64-linux/include/datadog/log.h +0 -0
  86. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/x86_64-linux/include/datadog/profiling.h +0 -0
  87. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/x86_64-linux/include/datadog/telemetry.h +0 -0
  88. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/x86_64-linux-musl/LICENSE +0 -0
  89. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/x86_64-linux-musl/NOTICE +0 -0
  90. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/x86_64-linux-musl/include/datadog/blazesym.h +0 -0
  91. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/x86_64-linux-musl/include/datadog/crashtracker.h +0 -0
  92. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/x86_64-linux-musl/include/datadog/ddsketch.h +0 -0
  93. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/x86_64-linux-musl/include/datadog/ffe.h +0 -0
  94. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/x86_64-linux-musl/include/datadog/library-config.h +0 -0
  95. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/x86_64-linux-musl/include/datadog/log.h +0 -0
  96. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/x86_64-linux-musl/include/datadog/profiling.h +0 -0
  97. /data/vendor/{libdatadog-36.0.0 → libdatadog-37.0.0}/x86_64-linux-musl/include/datadog/telemetry.h +0 -0
@@ -0,0 +1,425 @@
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
+ void ddog_trace_exporter_config_new(struct ddog_TraceExporterConfig **out_handle);
37
+
38
+ /**
39
+ * Frees TraceExporterConfig handle internal resources.
40
+ */
41
+ void ddog_trace_exporter_config_free(struct ddog_TraceExporterConfig *handle);
42
+
43
+ /**
44
+ * Sets traces destination.
45
+ */
46
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_url(struct ddog_TraceExporterConfig *config,
47
+ ddog_CharSlice url);
48
+
49
+ /**
50
+ * Sets tracer's version to be included in the headers request.
51
+ */
52
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_tracer_version(struct ddog_TraceExporterConfig *config,
53
+ ddog_CharSlice version);
54
+
55
+ /**
56
+ * Sets tracer's language to be included in the headers request.
57
+ */
58
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_language(struct ddog_TraceExporterConfig *config,
59
+ ddog_CharSlice lang);
60
+
61
+ /**
62
+ * Sets tracer's language version to be included in the headers request.
63
+ */
64
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_lang_version(struct ddog_TraceExporterConfig *config,
65
+ ddog_CharSlice version);
66
+
67
+ /**
68
+ * Sets tracer's language interpreter to be included in the headers request.
69
+ */
70
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_lang_interpreter(struct ddog_TraceExporterConfig *config,
71
+ ddog_CharSlice interpreter);
72
+
73
+ /**
74
+ * Sets hostname information to be included in the headers request.
75
+ */
76
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_hostname(struct ddog_TraceExporterConfig *config,
77
+ ddog_CharSlice hostname);
78
+
79
+ /**
80
+ * Sets environment information to be included in the headers request.
81
+ */
82
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_env(struct ddog_TraceExporterConfig *config,
83
+ ddog_CharSlice env);
84
+
85
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_version(struct ddog_TraceExporterConfig *config,
86
+ ddog_CharSlice version);
87
+
88
+ /**
89
+ * Sets service name to be included in the headers request.
90
+ */
91
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_service(struct ddog_TraceExporterConfig *config,
92
+ ddog_CharSlice service);
93
+
94
+ /**
95
+ * Enables health metrics emission.
96
+ */
97
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_enable_health_metrics(struct ddog_TraceExporterConfig *config,
98
+ bool is_enabled);
99
+
100
+ /**
101
+ * Enables telemetry metrics.
102
+ */
103
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_enable_telemetry(struct ddog_TraceExporterConfig *config,
104
+ const struct ddog_TelemetryClientConfig *telemetry_cfg);
105
+
106
+ /**
107
+ * Set client-side stats computation status.
108
+ */
109
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_compute_stats(struct ddog_TraceExporterConfig *config,
110
+ bool is_enabled);
111
+
112
+ /**
113
+ * Sets `Datadog-Client-Computed-Stats` header to `true`.
114
+ * This indicates that the upstream system has already computed the stats,
115
+ * and no further stats computation should be performed.
116
+ *
117
+ * <div class="warning">
118
+ * This method must not be used when `compute_stats` is enabled, as it could
119
+ * result in duplicate stats computation.
120
+ * </div>
121
+ *
122
+ * A common use case is in Application Security Monitoring (ASM) scenarios:
123
+ * when APM is disabled but ASM is enabled, setting this header to `true`
124
+ * ensures that no stats are computed at any level (exporter or agent).
125
+ */
126
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_client_computed_stats(struct ddog_TraceExporterConfig *config,
127
+ bool client_computed_stats);
128
+
129
+ /**
130
+ * Sets the process tags to be included in the stats payload.
131
+ */
132
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_process_tags(struct ddog_TraceExporterConfig *config,
133
+ ddog_CharSlice process_tags);
134
+
135
+ /**
136
+ * Sets the `X-Datadog-Test-Session-Token` header. Only used for testing with the test agent.
137
+ */
138
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_test_session_token(struct ddog_TraceExporterConfig *config,
139
+ ddog_CharSlice token);
140
+
141
+ /**
142
+ * Sets the timeout in ms for all agent's connections.
143
+ */
144
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_connection_timeout(struct ddog_TraceExporterConfig *config,
145
+ uint64_t timeout_ms);
146
+
147
+ /**
148
+ * Sets a shared runtime for the TraceExporter to use for background workers.
149
+ *
150
+ * `handle` must have been initialized with [`ddog_shared_runtime_new`].
151
+ *
152
+ * When set, the exporter will use the provided runtime instead of creating its own.
153
+ * This allows multiple exporters (or other components) to share a single runtime.
154
+ * The config holds a clone of the `Arc` (increments the strong count), so the
155
+ * original handle remains valid and must still be freed with
156
+ * [`ddog_shared_runtime_free`].
157
+ */
158
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_shared_runtime(struct ddog_TraceExporterConfig *config,
159
+ struct ddog_ForkSafeRuntime *handle);
160
+
161
+ /**
162
+ * Enables OTLP HTTP/JSON export and sets the endpoint URL.
163
+ *
164
+ * When set, traces are sent to this URL in OTLP HTTP/JSON format instead of the Datadog
165
+ * agent. The host language is responsible for resolving the endpoint from its configuration
166
+ * (e.g. `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT`) before calling this function.
167
+ */
168
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_otlp_endpoint(struct ddog_TraceExporterConfig *config,
169
+ ddog_CharSlice url);
170
+
171
+ /**
172
+ * Sets the OTLP export protocol. Accepts the OTel-standard values `http/json` (default) or
173
+ * `http/protobuf`; `grpc` is rejected as not yet supported. The host language resolves the value
174
+ * (e.g. from `OTEL_EXPORTER_OTLP_TRACES_PROTOCOL`).
175
+ *
176
+ * Has no effect unless an OTLP endpoint is also configured via
177
+ * `ddog_trace_exporter_config_set_otlp_endpoint`; without one, traces are sent to the
178
+ * Datadog agent and this protocol selection is ignored.
179
+ *
180
+ * Returns `None` on success, `ErrorCode::InvalidArgument` for a null config or an unaccepted
181
+ * value, and `ErrorCode::InvalidInput` for a non-UTF-8 string.
182
+ */
183
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_otlp_protocol(struct ddog_TraceExporterConfig *config,
184
+ ddog_CharSlice protocol);
185
+
186
+ /**
187
+ * Configure the exporter to write traces as newline-delimited JSON to stdout (the Datadog
188
+ * Forwarder "log exporter" path) instead of sending them to a Datadog agent. Used in serverless
189
+ * environments (e.g. AWS Lambda) when no agent is reachable.
190
+ *
191
+ * `max_line_size` overrides the per-line byte cap; pass `0` to use the default (256 KiB, the AWS
192
+ * CloudWatch Logs limit). When enabled, agent-specific behavior (agent-info polling, client-side
193
+ * stats, V1 negotiation) is bypassed.
194
+ *
195
+ * In this mode each span's `meta` is serialized to process stdout (and thus captured by CloudWatch
196
+ * Logs in Lambda); `meta_struct` is excluded because it holds raw msgpack the log intake cannot
197
+ * interpret.
198
+ *
199
+ * Writes are synchronous/blocking on stdout, so this mode targets single-threaded / current-thread
200
+ * serverless runtimes (e.g. AWS Lambda) where a blocking write won't stall a shared async reactor.
201
+ */
202
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_output_to_log(struct ddog_TraceExporterConfig *config,
203
+ uintptr_t max_line_size);
204
+
205
+ /**
206
+ * Create a new TraceExporter instance.
207
+ *
208
+ * When an OTLP endpoint is configured via `TraceExporterConfig`, the exporter sends traces to
209
+ * that endpoint in OTLP over HTTP — JSON or protobuf per the configured protocol — instead of
210
+ * to the Datadog agent. The same payload (e.g. MessagePack) is passed to
211
+ * `ddog_trace_exporter_send`; the library decodes and converts it to OTLP when OTLP is enabled.
212
+ *
213
+ * # Arguments
214
+ *
215
+ * * `out_handle` - The handle to write the TraceExporter instance in.
216
+ * * `config` - The configuration used to set up the TraceExporter handle.
217
+ */
218
+ struct ddog_TraceExporterError *ddog_trace_exporter_new(ddog_TraceExporter **out_handle,
219
+ const struct ddog_TraceExporterConfig *config);
220
+
221
+ /**
222
+ * Free the TraceExporter instance.
223
+ *
224
+ * # Arguments
225
+ *
226
+ * * handle - The handle to the TraceExporter instance.
227
+ */
228
+ void ddog_trace_exporter_free(ddog_TraceExporter *handle);
229
+
230
+ /**
231
+ * Send traces to the Datadog Agent.
232
+ *
233
+ * # Arguments
234
+ *
235
+ * * `handle` - The handle to the TraceExporter instance.
236
+ * * `trace` - The traces to send to the Datadog Agent in the input format used to create the
237
+ * TraceExporter. The memory for the trace must be valid for the life of the call to this
238
+ * function.
239
+ * * `trace_count` - The number of traces to send to the Datadog Agent.
240
+ * * `response_out` - Optional handle to store a pointer to the agent response information.
241
+ */
242
+ struct ddog_TraceExporterError *ddog_trace_exporter_send(const ddog_TraceExporter *handle,
243
+ ddog_ByteSlice trace,
244
+ struct ddog_TraceExporterResponse **response_out);
245
+
246
+ /**
247
+ * Create a new span with all scalar fields set.
248
+ *
249
+ * String fields are copied from the provided slices. The `meta` and
250
+ * `metrics` maps start empty; use [`ddog_tracer_span_set_meta`] and
251
+ * [`ddog_tracer_span_set_metric`] to populate them.
252
+ *
253
+ * # Safety
254
+ *
255
+ * `out_handle` must point to valid, writable memory for a `Box<TracerSpan>`.
256
+ * All `CharSlice` fields in `fields` must point to valid memory for their
257
+ * stated length.
258
+ */
259
+ struct ddog_TraceExporterError *ddog_tracer_span_new(ddog_TracerSpan **out_handle,
260
+ const struct ddog_TracerSpanFields *fields);
261
+
262
+ /**
263
+ * Free a `TracerSpan` and all its contents.
264
+ *
265
+ * After this call the handle is invalid and must not be reused.
266
+ *
267
+ * # Safety
268
+ *
269
+ * `handle` must have been created by [`ddog_tracer_span_new`] and must not
270
+ * be used after this call.
271
+ */
272
+ void ddog_tracer_span_free(ddog_TracerSpan *handle);
273
+
274
+ /**
275
+ * Add or overwrite a string tag (`meta`) on the span.
276
+ *
277
+ * Both `key` and `value` are copied into the span.
278
+ *
279
+ * # Safety
280
+ *
281
+ * `handle` must be a valid pointer to a `TracerSpan`.
282
+ * `key` and `value` must point to valid UTF-8 memory.
283
+ */
284
+ struct ddog_TraceExporterError *ddog_tracer_span_set_meta(ddog_TracerSpan *handle,
285
+ ddog_CharSlice key,
286
+ ddog_CharSlice value);
287
+
288
+ /**
289
+ * Add or overwrite a numeric tag (`metric`) on the span.
290
+ *
291
+ * The `key` is copied into the span.
292
+ *
293
+ * # Safety
294
+ *
295
+ * `handle` must be a valid pointer to a `TracerSpan`.
296
+ * `key` must point to valid UTF-8 memory.
297
+ */
298
+ struct ddog_TraceExporterError *ddog_tracer_span_set_metric(ddog_TracerSpan *handle,
299
+ ddog_CharSlice key,
300
+ double value);
301
+
302
+ /**
303
+ * Create a new empty trace chunks container.
304
+ *
305
+ * `capacity` is a hint for the expected number of chunks; pass 0 if
306
+ * unknown.
307
+ *
308
+ * # Safety
309
+ *
310
+ * `out_handle` must point to valid, writable memory for a
311
+ * `Box<TracerTraceChunks>`.
312
+ */
313
+ struct ddog_TraceExporterError *ddog_tracer_trace_chunks_new(uintptr_t capacity,
314
+ ddog_TracerTraceChunks **out_handle);
315
+
316
+ /**
317
+ * Free a trace chunks container and all its contents.
318
+ *
319
+ * After this call the handle is invalid and must not be reused.
320
+ *
321
+ * # Safety
322
+ *
323
+ * `handle` must have been created by [`ddog_tracer_trace_chunks_new`].
324
+ */
325
+ void ddog_tracer_trace_chunks_free(ddog_TracerTraceChunks *handle);
326
+
327
+ /**
328
+ * Start a new chunk (trace) inside the container.
329
+ *
330
+ * Subsequent [`ddog_tracer_trace_chunks_push_span`] calls will append
331
+ * spans to this chunk until the next `begin_chunk` call.
332
+ *
333
+ * `capacity` is a hint for the expected number of spans in this chunk;
334
+ * pass 0 if unknown.
335
+ *
336
+ * # Safety
337
+ *
338
+ * `handle` must be a valid pointer to a `TracerTraceChunks`.
339
+ */
340
+ struct ddog_TraceExporterError *ddog_tracer_trace_chunks_begin_chunk(ddog_TracerTraceChunks *handle,
341
+ uintptr_t capacity);
342
+
343
+ /**
344
+ * Move a span into the current (last) chunk, consuming the span handle.
345
+ *
346
+ * A chunk must have been started with
347
+ * [`ddog_tracer_trace_chunks_begin_chunk`] before calling this function.
348
+ *
349
+ * # Safety
350
+ *
351
+ * * `handle` must be a valid pointer to a `TracerTraceChunks`.
352
+ * * `span` is consumed and must not be used after this call.
353
+ */
354
+ struct ddog_TraceExporterError *ddog_tracer_trace_chunks_push_span(ddog_TracerTraceChunks *handle,
355
+ ddog_TracerSpan *span);
356
+
357
+ /**
358
+ * Create a new cancellation token.
359
+ *
360
+ * The returned token must be freed with
361
+ * [`ddog_trace_exporter_cancel_token_drop`].
362
+ */
363
+ ddog_TraceExporterCancelToken *ddog_trace_exporter_cancel_token_new(void);
364
+
365
+ /**
366
+ * Cancel a cancellation token.
367
+ *
368
+ * All clones of the same token observe the cancellation. If a
369
+ * [`ddog_trace_exporter_send_trace_chunks`] call is using this token at the
370
+ * time of cancellation, that send stops waiting for the agent at its next
371
+ * await point and returns an error; the trace chunks it was sending may be
372
+ * lost.
373
+ *
374
+ * Cancellation only affects a send that is in progress. If no send is using
375
+ * the token, cancelling it has no immediate effect: a send started afterwards
376
+ * with an already-cancelled token returns an error without contacting the
377
+ * agent, and a token cancelled after its send has already finished does
378
+ * nothing.
379
+ */
380
+ void ddog_trace_exporter_cancel_token_cancel(const ddog_TraceExporterCancelToken *token);
381
+
382
+ /**
383
+ * Free a cancellation token.
384
+ *
385
+ * After this call the token is invalid and must not be reused.
386
+ */
387
+ void ddog_trace_exporter_cancel_token_drop(ddog_TraceExporterCancelToken *token);
388
+
389
+ /**
390
+ * Send trace chunks through a [`TraceExporter`], consuming the chunks.
391
+ *
392
+ * This calls `TraceExporter::send_trace_chunks` which processes stats,
393
+ * serializes in the configured output format, and sends to the agent
394
+ * with retry logic.
395
+ *
396
+ * When `cancel` is non-null, cancelling that token (via
397
+ * [`ddog_trace_exporter_cancel_token_cancel`]) while the send is in progress
398
+ * aborts the in-flight request and returns an error with code
399
+ * [`ExporterErrorCode::IoError`]. Cancellation is cooperative: it only takes
400
+ * effect while a request is actually in flight. A token that is already
401
+ * cancelled when the send starts makes this function return that error
402
+ * immediately, and cancelling after the send has finished has no effect.
403
+ * Cancelling an in-flight send may cause the trace chunks being sent to be
404
+ * lost.
405
+ *
406
+ * On success, if `response_out` is non-null, a heap-allocated
407
+ * [`ExporterResponse`] is written there. The caller owns it and must
408
+ * free it with `ddog_trace_exporter_response_free`.
409
+ *
410
+ * # Safety
411
+ *
412
+ * * `chunks` is consumed and must not be used after this call.
413
+ * * If `response_out` is non-null it must point to valid writable memory for a
414
+ * `Box<ExporterResponse>`.
415
+ */
416
+ struct ddog_TraceExporterError *ddog_trace_exporter_send_trace_chunks(const ddog_TraceExporter *exporter,
417
+ ddog_TracerTraceChunks *chunks,
418
+ struct ddog_TraceExporterResponse **response_out,
419
+ const ddog_TraceExporterCancelToken *cancel);
420
+
421
+ #ifdef __cplusplus
422
+ } // extern "C"
423
+ #endif // __cplusplus
424
+
425
+ #endif /* DDOG_DATA_PIPELINE_H */
@@ -0,0 +1,91 @@
1
+ // Copyright 2025-Present Datadog, Inc. https://www.datadoghq.com/
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+
5
+ #ifndef DDOG_SHARED_RUNTIME_H
6
+ #define DDOG_SHARED_RUNTIME_H
7
+
8
+ #include <stdarg.h>
9
+ #include <stdbool.h>
10
+ #include <stdint.h>
11
+ #include <stdlib.h>
12
+
13
+ #ifdef __cplusplus
14
+ extern "C" {
15
+ #endif // __cplusplus
16
+
17
+ /**
18
+ * Frees a `SharedRuntimeFFIError`. After this call the pointer is invalid.
19
+ */
20
+ void ddog_shared_runtime_error_free(struct ddog_SharedRuntimeFFIError *error);
21
+
22
+ /**
23
+ * Create a new `ForkSafeRuntime`.
24
+ *
25
+ * On success writes a raw handle into `*out_handle` and returns `None`.
26
+ * On failure leaves `*out_handle` unchanged and returns an error.
27
+ *
28
+ * The caller owns the handle and must eventually pass it to
29
+ * [`ddog_shared_runtime_free`] (or another consumer that takes ownership).
30
+ */
31
+ struct ddog_SharedRuntimeFFIError *ddog_shared_runtime_new(const struct ddog_ForkSafeRuntime **out_handle);
32
+
33
+ /**
34
+ * Free a handle, decrementing the `Arc` strong count.
35
+ *
36
+ * The underlying runtime may not be dropped if other components are still using it.
37
+ * Use [`ddog_shared_runtime_shutdown`] to cleanly stop workers.
38
+ */
39
+ void ddog_shared_runtime_free(const struct ddog_ForkSafeRuntime *handle);
40
+
41
+ /**
42
+ * Must be called in the parent process before `fork()`.
43
+ *
44
+ * Pauses all workers so that no background threads are running during the
45
+ * fork, preventing deadlocks in the child process.
46
+ *
47
+ * Returns an error if `handle` is null.
48
+ * The handle must have been initialized with `ddog_shared_runtime_new`.
49
+ */
50
+ struct ddog_SharedRuntimeFFIError *ddog_shared_runtime_before_fork(const struct ddog_ForkSafeRuntime *handle);
51
+
52
+ /**
53
+ * Must be called in the parent process after `fork()`.
54
+ *
55
+ * Restarts all workers that were paused by [`ddog_shared_runtime_before_fork`].
56
+ *
57
+ * Returns `None` on success, or an error if workers could not be restarted.
58
+ * The handle must have been initialized with `ddog_shared_runtime_new`.
59
+ */
60
+ struct ddog_SharedRuntimeFFIError *ddog_shared_runtime_after_fork_parent(const struct ddog_ForkSafeRuntime *handle);
61
+
62
+ /**
63
+ * Must be called in the child process after `fork()`.
64
+ *
65
+ * Creates a fresh tokio runtime and restarts all workers. The original
66
+ * runtime cannot be safely reused after a fork.
67
+ *
68
+ * Returns `None` on success, or an error if the runtime could not be
69
+ * reinitialized.
70
+ * The handle must have been initialized with `ddog_shared_runtime_new`.
71
+ */
72
+ struct ddog_SharedRuntimeFFIError *ddog_shared_runtime_after_fork_child(const struct ddog_ForkSafeRuntime *handle);
73
+
74
+ /**
75
+ * Shut down the `ForkSafeRuntime`, stopping all workers.
76
+ *
77
+ * `timeout_ms` is the maximum time to wait for workers to stop, in
78
+ * milliseconds. Pass `0` for no timeout.
79
+ *
80
+ * Returns `None` on success, or `SharedRuntimeErrorCode::ShutdownTimedOut`
81
+ * if the timeout was reached.
82
+ * The handle must have been initialized with `ddog_shared_runtime_new`.
83
+ */
84
+ struct ddog_SharedRuntimeFFIError *ddog_shared_runtime_shutdown(const struct ddog_ForkSafeRuntime *handle,
85
+ uint64_t timeout_ms);
86
+
87
+ #ifdef __cplusplus
88
+ } // extern "C"
89
+ #endif // __cplusplus
90
+
91
+ #endif /* DDOG_SHARED_RUNTIME_H */
@@ -0,0 +1,15 @@
1
+ # Copyright 2021-Present Datadog, Inc. https://www.datadoghq.com/
2
+ # SPDX-License-Identifier: Apache-2.0
3
+
4
+ prefix=${pcfiledir}/../..
5
+ exec_prefix=${prefix}
6
+ libdir=${exec_prefix}/lib
7
+ includedir=${prefix}/include
8
+
9
+ Name: datadog_profiling
10
+ Description: Contains common code used to implement Datadog's Continuous Profilers. (Dynamic linking variant, sets rpath)
11
+ Version: 37.0.0
12
+ Requires:
13
+ Libs: -L${libdir} -ldatadog_profiling -Wl,-rpath,${libdir}
14
+ Libs.private:
15
+ Cflags: -I${includedir}
@@ -125,6 +125,7 @@ dispatch2,https://github.com/madsmtm/objc2,Zlib OR Apache-2.0 OR MIT,"Mads Marqu
125
125
  displaydoc,https://github.com/yaahc/displaydoc,MIT OR Apache-2.0,Jane Lusby <jlusby@yaah.dev>
126
126
  dyn-clone,https://github.com/dtolnay/dyn-clone,MIT OR Apache-2.0,David Tolnay <dtolnay@gmail.com>
127
127
  either,https://github.com/rayon-rs/either,MIT OR Apache-2.0,bluss
128
+ elf,https://github.com/cole14/rust-elf,MIT OR Apache-2.0,Christopher Cole <chris.cole.09@gmail.com>
128
129
  encoding_rs,https://github.com/hsivonen/encoding_rs,(Apache-2.0 OR MIT) AND BSD-3-Clause,Henri Sivonen <hsivonen@hsivonen.fi>
129
130
  enum-as-inner,https://github.com/bluejekyll/enum-as-inner,MIT OR Apache-2.0,Benjamin Fry <benjaminfry@me.com>
130
131
  equivalent,https://github.com/cuviper/equivalent,Apache-2.0 OR MIT,The equivalent Authors
@@ -1670,20 +1670,13 @@ typedef enum ddog_TraceExporterErrorCode {
1670
1670
  typedef struct ddog_TraceExporterResponse ddog_TraceExporterResponse;
1671
1671
 
1672
1672
  /**
1673
- * A shared runtime that manages PausableWorkers and provides fork safety hooks.
1673
+ * Owns a tokio runtime and manages [`PausableWorker`]s on it.
1674
1674
  *
1675
- * The SharedRuntime owns a tokio runtime (on native) and tracks PausableWorkers
1676
- * spawned on it. It provides methods to safely pause workers before forking and
1677
- * restart them after fork in both parent and child processes.
1678
- *
1679
- * On wasm32, no tokio runtime is created. Workers are spawned via `spawn_local`
1680
- * on the JS event loop.
1681
- *
1682
- * # Mutex lock order
1683
- * When locking both [Self::runtime] and [Self::workers], the mutex must be locked in the order of
1684
- * the fields in the struct. When possible avoid holding both locks simultaneously.
1675
+ * Supports the full fork protocol ([`before_fork`](Self::before_fork) /
1676
+ * [`after_fork_parent`](Self::after_fork_parent) /
1677
+ * [`after_fork_child`](Self::after_fork_child)) and synchronous [`shutdown`](Self::shutdown).
1685
1678
  */
1686
- typedef struct ddog_SharedRuntime ddog_SharedRuntime;
1679
+ typedef struct ddog_ForkSafeRuntime ddog_ForkSafeRuntime;
1687
1680
 
1688
1681
  /**
1689
1682
  * The TraceExporterConfig object will hold the configuration properties for the TraceExporter.
@@ -2234,7 +2227,7 @@ typedef struct ddog_ffe_AttributePair {
2234
2227
  } ddog_ffe_AttributePair;
2235
2228
 
2236
2229
  /**
2237
- * Error codes for SharedRuntime FFI operations.
2230
+ * Error codes for ForkSafeRuntime FFI operations.
2238
2231
  */
2239
2232
  typedef enum ddog_SharedRuntimeErrorCode {
2240
2233
  /**
@@ -2268,7 +2261,7 @@ typedef enum ddog_SharedRuntimeErrorCode {
2268
2261
  } ddog_SharedRuntimeErrorCode;
2269
2262
 
2270
2263
  /**
2271
- * Error returned by SharedRuntime FFI functions.
2264
+ * Error returned by ForkSafeRuntime FFI functions.
2272
2265
  */
2273
2266
  typedef struct ddog_SharedRuntimeFFIError {
2274
2267
  enum ddog_SharedRuntimeErrorCode code;
@@ -156,7 +156,7 @@ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_connection_timeou
156
156
  * [`ddog_shared_runtime_free`].
157
157
  */
158
158
  struct ddog_TraceExporterError *ddog_trace_exporter_config_set_shared_runtime(struct ddog_TraceExporterConfig *config,
159
- struct ddog_SharedRuntime *handle);
159
+ struct ddog_ForkSafeRuntime *handle);
160
160
 
161
161
  /**
162
162
  * Enables OTLP HTTP/JSON export and sets the endpoint URL.
@@ -168,13 +168,47 @@ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_shared_runtime(st
168
168
  struct ddog_TraceExporterError *ddog_trace_exporter_config_set_otlp_endpoint(struct ddog_TraceExporterConfig *config,
169
169
  ddog_CharSlice url);
170
170
 
171
+ /**
172
+ * Sets the OTLP export protocol. Accepts the OTel-standard values `http/json` (default) or
173
+ * `http/protobuf`; `grpc` is rejected as not yet supported. The host language resolves the value
174
+ * (e.g. from `OTEL_EXPORTER_OTLP_TRACES_PROTOCOL`).
175
+ *
176
+ * Has no effect unless an OTLP endpoint is also configured via
177
+ * `ddog_trace_exporter_config_set_otlp_endpoint`; without one, traces are sent to the
178
+ * Datadog agent and this protocol selection is ignored.
179
+ *
180
+ * Returns `None` on success, `ErrorCode::InvalidArgument` for a null config or an unaccepted
181
+ * value, and `ErrorCode::InvalidInput` for a non-UTF-8 string.
182
+ */
183
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_otlp_protocol(struct ddog_TraceExporterConfig *config,
184
+ ddog_CharSlice protocol);
185
+
186
+ /**
187
+ * Configure the exporter to write traces as newline-delimited JSON to stdout (the Datadog
188
+ * Forwarder "log exporter" path) instead of sending them to a Datadog agent. Used in serverless
189
+ * environments (e.g. AWS Lambda) when no agent is reachable.
190
+ *
191
+ * `max_line_size` overrides the per-line byte cap; pass `0` to use the default (256 KiB, the AWS
192
+ * CloudWatch Logs limit). When enabled, agent-specific behavior (agent-info polling, client-side
193
+ * stats, V1 negotiation) is bypassed.
194
+ *
195
+ * In this mode each span's `meta` is serialized to process stdout (and thus captured by CloudWatch
196
+ * Logs in Lambda); `meta_struct` is excluded because it holds raw msgpack the log intake cannot
197
+ * interpret.
198
+ *
199
+ * Writes are synchronous/blocking on stdout, so this mode targets single-threaded / current-thread
200
+ * serverless runtimes (e.g. AWS Lambda) where a blocking write won't stall a shared async reactor.
201
+ */
202
+ struct ddog_TraceExporterError *ddog_trace_exporter_config_set_output_to_log(struct ddog_TraceExporterConfig *config,
203
+ uintptr_t max_line_size);
204
+
171
205
  /**
172
206
  * Create a new TraceExporter instance.
173
207
  *
174
- * When an OTLP endpoint is configured via `TraceExporterConfig`, the exporter sends traces in
175
- * OTLP HTTP/JSON to that endpoint instead of the Datadog agent. The same payload (e.g.
176
- * MessagePack) is passed to `ddog_trace_exporter_send`; the library decodes and converts to
177
- * OTLP when OTLP is enabled.
208
+ * When an OTLP endpoint is configured via `TraceExporterConfig`, the exporter sends traces to
209
+ * that endpoint in OTLP over HTTP — JSON or protobuf per the configured protocol — instead of
210
+ * to the Datadog agent. The same payload (e.g. MessagePack) is passed to
211
+ * `ddog_trace_exporter_send`; the library decodes and converts it to OTLP when OTLP is enabled.
178
212
  *
179
213
  * # Arguments
180
214
  *