libdatadog 35.0.0.1.0-x86_64-linux → 36.0.0.1.0-x86_64-linux

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 (37) hide show
  1. checksums.yaml +4 -4
  2. data/lib/libdatadog/version.rb +1 -1
  3. data/vendor/{libdatadog-35.0.0/x86_64-linux-musl → libdatadog-36.0.0/x86_64-linux}/LICENSE-3rdparty.csv +1 -0
  4. data/vendor/{libdatadog-35.0.0 → libdatadog-36.0.0}/x86_64-linux/bin/libdatadog-crashtracking-receiver +0 -0
  5. data/vendor/{libdatadog-35.0.0 → libdatadog-36.0.0}/x86_64-linux/include/datadog/common.h +47 -0
  6. data/vendor/{libdatadog-35.0.0/x86_64-linux-musl → libdatadog-36.0.0/x86_64-linux}/include/datadog/crashtracker.h +19 -0
  7. data/vendor/{libdatadog-35.0.0/x86_64-linux-musl → libdatadog-36.0.0/x86_64-linux}/include/datadog/data-pipeline.h +44 -2
  8. data/vendor/{libdatadog-35.0.0 → libdatadog-36.0.0}/x86_64-linux/include/datadog/profiling.h +18 -0
  9. data/vendor/libdatadog-36.0.0/x86_64-linux/include/datadog/shared-runtime.h +91 -0
  10. data/vendor/{libdatadog-35.0.0 → libdatadog-36.0.0}/x86_64-linux/lib/libdatadog_profiling.so +0 -0
  11. data/vendor/{libdatadog-35.0.0 → libdatadog-36.0.0}/x86_64-linux/lib/pkgconfig/datadog_profiling_with_rpath.pc +1 -1
  12. data/vendor/{libdatadog-35.0.0/x86_64-linux → libdatadog-36.0.0/x86_64-linux-musl}/LICENSE-3rdparty.csv +1 -0
  13. data/vendor/{libdatadog-35.0.0 → libdatadog-36.0.0}/x86_64-linux-musl/bin/libdatadog-crashtracking-receiver +0 -0
  14. data/vendor/{libdatadog-35.0.0 → libdatadog-36.0.0}/x86_64-linux-musl/include/datadog/common.h +47 -0
  15. data/vendor/{libdatadog-35.0.0/x86_64-linux → libdatadog-36.0.0/x86_64-linux-musl}/include/datadog/crashtracker.h +19 -0
  16. data/vendor/{libdatadog-35.0.0/x86_64-linux → libdatadog-36.0.0/x86_64-linux-musl}/include/datadog/data-pipeline.h +44 -2
  17. data/vendor/{libdatadog-35.0.0 → libdatadog-36.0.0}/x86_64-linux-musl/include/datadog/profiling.h +18 -0
  18. data/vendor/libdatadog-36.0.0/x86_64-linux-musl/include/datadog/shared-runtime.h +91 -0
  19. data/vendor/{libdatadog-35.0.0 → libdatadog-36.0.0}/x86_64-linux-musl/lib/libdatadog_profiling.so +0 -0
  20. data/vendor/{libdatadog-35.0.0 → libdatadog-36.0.0}/x86_64-linux-musl/lib/pkgconfig/datadog_profiling_with_rpath.pc +1 -1
  21. metadata +35 -33
  22. /data/vendor/{libdatadog-35.0.0 → libdatadog-36.0.0}/x86_64-linux/LICENSE +0 -0
  23. /data/vendor/{libdatadog-35.0.0 → libdatadog-36.0.0}/x86_64-linux/NOTICE +0 -0
  24. /data/vendor/{libdatadog-35.0.0 → libdatadog-36.0.0}/x86_64-linux/include/datadog/blazesym.h +0 -0
  25. /data/vendor/{libdatadog-35.0.0 → libdatadog-36.0.0}/x86_64-linux/include/datadog/ddsketch.h +0 -0
  26. /data/vendor/{libdatadog-35.0.0 → libdatadog-36.0.0}/x86_64-linux/include/datadog/ffe.h +0 -0
  27. /data/vendor/{libdatadog-35.0.0 → libdatadog-36.0.0}/x86_64-linux/include/datadog/library-config.h +0 -0
  28. /data/vendor/{libdatadog-35.0.0 → libdatadog-36.0.0}/x86_64-linux/include/datadog/log.h +0 -0
  29. /data/vendor/{libdatadog-35.0.0 → libdatadog-36.0.0}/x86_64-linux/include/datadog/telemetry.h +0 -0
  30. /data/vendor/{libdatadog-35.0.0 → libdatadog-36.0.0}/x86_64-linux-musl/LICENSE +0 -0
  31. /data/vendor/{libdatadog-35.0.0 → libdatadog-36.0.0}/x86_64-linux-musl/NOTICE +0 -0
  32. /data/vendor/{libdatadog-35.0.0 → libdatadog-36.0.0}/x86_64-linux-musl/include/datadog/blazesym.h +0 -0
  33. /data/vendor/{libdatadog-35.0.0 → libdatadog-36.0.0}/x86_64-linux-musl/include/datadog/ddsketch.h +0 -0
  34. /data/vendor/{libdatadog-35.0.0 → libdatadog-36.0.0}/x86_64-linux-musl/include/datadog/ffe.h +0 -0
  35. /data/vendor/{libdatadog-35.0.0 → libdatadog-36.0.0}/x86_64-linux-musl/include/datadog/library-config.h +0 -0
  36. /data/vendor/{libdatadog-35.0.0 → libdatadog-36.0.0}/x86_64-linux-musl/include/datadog/log.h +0 -0
  37. /data/vendor/{libdatadog-35.0.0 → libdatadog-36.0.0}/x86_64-linux-musl/include/datadog/telemetry.h +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 45d4680eda573cea7e6d14d564022294ad855ac995472cc2e172a658aee94467
4
- data.tar.gz: 3af9f0936c9293ef5e13bff7d56a7e996842bd2568c723c3ed4aac7e63177eaa
3
+ metadata.gz: f3469857cfe67144374978220a70da9214c26e3d4489ed1e66087cad772773e6
4
+ data.tar.gz: 45250a8512a22fbf0c7ca4ef063f4fa01563c7530e689a2fe9144781b8ca9051
5
5
  SHA512:
6
- metadata.gz: 4e4852049a6520a59e06665e957c9ace20fccbc869bb9ade5f3f8c750fb463cd702a5d71d7b7c1dc2cc52bad3c6913a6c8b9cf47a80009bb4da9cea09ba1b112
7
- data.tar.gz: cfa06a632f6551f9bb3a8395b54eb30266f2fae17a0c7da5f53db6df1281890bc738fa3c38eb00ce864e2fc516c23cd1932b9253787cca03a6b7952fdbed007c
6
+ metadata.gz: 59fcff863006eee3320a4899802ba143743ac404bcc5a499d3ecd720662b6fa3c268fd1dcb6e3e8a698a3c3ba2d94ebdeedd6c554dbe78de9ef486a5c49b5ab6
7
+ data.tar.gz: 9baa8322fd45a20a4d2fe542116339b6f5637a42a3880b05f34b32f35739804058b50280f040721cadebd92aa63041490ac90b582fb27a60e152b23a787c5ce2
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Libdatadog
4
4
  # Current libdatadog version
5
- LIB_VERSION = "35.0.0"
5
+ LIB_VERSION = "36.0.0"
6
6
 
7
7
  GEM_MAJOR_VERSION = "1"
8
8
  GEM_MINOR_VERSION = "0"
@@ -429,6 +429,7 @@ target-triple,https://github.com/dtolnay/target-triple,MIT OR Apache-2.0,David T
429
429
  tempfile,https://github.com/Stebalien/tempfile,MIT OR Apache-2.0,"Steven Allen <steven@stebalien.com>, The Rust Project Developers, Ashley Mannix <ashleymannix@live.com.au>, Jason White <me@jasonwhite.io>"
430
430
  termcolor,https://github.com/BurntSushi/termcolor,Unlicense OR MIT,Andrew Gallant <jamslam@gmail.com>
431
431
  test-case-macros,https://github.com/frondeus/test-case,MIT,"Marcin Sas-Szymanski <marcin.sas-szymanski@anixe.pl>, Wojciech Polak <frondeus@gmail.com>, Łukasz Biel <lukasz.p.biel@gmail.com>"
432
+ thin-vec,https://github.com/mozilla/thin-vec,MIT OR Apache-2.0,Aria Beingessner <a.beingessner@gmail.com>
432
433
  thiserror,https://github.com/dtolnay/thiserror,MIT OR Apache-2.0,David Tolnay <dtolnay@gmail.com>
433
434
  thiserror-impl,https://github.com/dtolnay/thiserror,MIT OR Apache-2.0,David Tolnay <dtolnay@gmail.com>
434
435
  thread_local,https://github.com/Amanieu/thread_local-rs,MIT OR Apache-2.0,Amanieu d'Antras <amanieu@gmail.com>
@@ -1626,6 +1626,7 @@ typedef struct ddog_ContextKey {
1626
1626
  typedef struct ddog_TraceExporter ddog_TraceExporter;
1627
1627
  typedef struct ddog_TracerSpan ddog_TracerSpan;
1628
1628
  typedef struct ddog_TracerTraceChunks ddog_TracerTraceChunks;
1629
+ typedef struct ddog_TraceExporterCancelToken ddog_TraceExporterCancelToken;
1629
1630
 
1630
1631
 
1631
1632
  /**
@@ -2232,6 +2233,52 @@ typedef struct ddog_ffe_AttributePair {
2232
2233
  struct ddog_ffe_AttributeValue value;
2233
2234
  } ddog_ffe_AttributePair;
2234
2235
 
2236
+ /**
2237
+ * Error codes for SharedRuntime FFI operations.
2238
+ */
2239
+ typedef enum ddog_SharedRuntimeErrorCode {
2240
+ /**
2241
+ * Invalid argument provided (e.g. null handle).
2242
+ */
2243
+ DDOG_SHARED_RUNTIME_ERROR_CODE_INVALID_ARGUMENT,
2244
+ /**
2245
+ * The runtime is not available or in an invalid state.
2246
+ */
2247
+ DDOG_SHARED_RUNTIME_ERROR_CODE_RUNTIME_UNAVAILABLE,
2248
+ /**
2249
+ * Failed to acquire a lock on internal state.
2250
+ */
2251
+ DDOG_SHARED_RUNTIME_ERROR_CODE_LOCK_FAILED,
2252
+ /**
2253
+ * A worker operation failed.
2254
+ */
2255
+ DDOG_SHARED_RUNTIME_ERROR_CODE_WORKER_ERROR,
2256
+ /**
2257
+ * Failed to create the tokio runtime.
2258
+ */
2259
+ DDOG_SHARED_RUNTIME_ERROR_CODE_RUNTIME_CREATION,
2260
+ /**
2261
+ * Shutdown timed out.
2262
+ */
2263
+ DDOG_SHARED_RUNTIME_ERROR_CODE_SHUTDOWN_TIMED_OUT,
2264
+ /**
2265
+ * An unexpected panic occurred inside the FFI call.
2266
+ */
2267
+ DDOG_SHARED_RUNTIME_ERROR_CODE_PANIC,
2268
+ } ddog_SharedRuntimeErrorCode;
2269
+
2270
+ /**
2271
+ * Error returned by SharedRuntime FFI functions.
2272
+ */
2273
+ typedef struct ddog_SharedRuntimeFFIError {
2274
+ enum ddog_SharedRuntimeErrorCode code;
2275
+ /**
2276
+ * The error message is always defined when the error is returned by a ddog_shared_runtime
2277
+ * ffi.
2278
+ */
2279
+ char *msg;
2280
+ } ddog_SharedRuntimeFFIError;
2281
+
2235
2282
  typedef enum ddog_crasht_BuildIdType {
2236
2283
  DDOG_CRASHT_BUILD_ID_TYPE_GNU,
2237
2284
  DDOG_CRASHT_BUILD_ID_TYPE_GO,
@@ -170,6 +170,25 @@ struct ddog_VoidResult ddog_crasht_report_unhandled_exception(ddog_CharSlice err
170
170
  ddog_CharSlice error_message,
171
171
  struct ddog_crasht_Handle_StackTrace *runtime_stack);
172
172
 
173
+ /**
174
+ * Register the expected PID of the socket-based crash receiver
175
+ *
176
+ * When `collect_all_threads` is enabled and the receiver is reached via a Unix
177
+ * socket, the crash handler will only grant ptrace permission if the socket
178
+ * peer's PID matches this registered value.
179
+ *
180
+ * Call this after establishing a trusted connection to the sidecar
181
+ *
182
+ * # Safety
183
+ * This function is safe to call from any thread at any time.
184
+ */
185
+ void ddog_crasht_set_expected_receiver_pid(int32_t pid);
186
+
187
+ /**
188
+ * Returns the currently registered expected receiver PID, or 0 if unset.
189
+ */
190
+ int32_t ddog_crasht_get_expected_receiver_pid(void);
191
+
173
192
  /**
174
193
  * Removes all existing additional tags
175
194
  * Expected to be used after a fork, to reset the additional tags on the child
@@ -320,6 +320,38 @@ struct ddog_TraceExporterError *ddog_tracer_trace_chunks_begin_chunk(ddog_Tracer
320
320
  struct ddog_TraceExporterError *ddog_tracer_trace_chunks_push_span(ddog_TracerTraceChunks *handle,
321
321
  ddog_TracerSpan *span);
322
322
 
323
+ /**
324
+ * Create a new cancellation token.
325
+ *
326
+ * The returned token must be freed with
327
+ * [`ddog_trace_exporter_cancel_token_drop`].
328
+ */
329
+ ddog_TraceExporterCancelToken *ddog_trace_exporter_cancel_token_new(void);
330
+
331
+ /**
332
+ * Cancel a cancellation token.
333
+ *
334
+ * All clones of the same token observe the cancellation. If a
335
+ * [`ddog_trace_exporter_send_trace_chunks`] call is using this token at the
336
+ * time of cancellation, that send stops waiting for the agent at its next
337
+ * await point and returns an error; the trace chunks it was sending may be
338
+ * lost.
339
+ *
340
+ * Cancellation only affects a send that is in progress. If no send is using
341
+ * the token, cancelling it has no immediate effect: a send started afterwards
342
+ * with an already-cancelled token returns an error without contacting the
343
+ * agent, and a token cancelled after its send has already finished does
344
+ * nothing.
345
+ */
346
+ void ddog_trace_exporter_cancel_token_cancel(const ddog_TraceExporterCancelToken *token);
347
+
348
+ /**
349
+ * Free a cancellation token.
350
+ *
351
+ * After this call the token is invalid and must not be reused.
352
+ */
353
+ void ddog_trace_exporter_cancel_token_drop(ddog_TraceExporterCancelToken *token);
354
+
323
355
  /**
324
356
  * Send trace chunks through a [`TraceExporter`], consuming the chunks.
325
357
  *
@@ -327,20 +359,30 @@ struct ddog_TraceExporterError *ddog_tracer_trace_chunks_push_span(ddog_TracerTr
327
359
  * serializes in the configured output format, and sends to the agent
328
360
  * with retry logic.
329
361
  *
362
+ * When `cancel` is non-null, cancelling that token (via
363
+ * [`ddog_trace_exporter_cancel_token_cancel`]) while the send is in progress
364
+ * aborts the in-flight request and returns an error with code
365
+ * [`ExporterErrorCode::IoError`]. Cancellation is cooperative: it only takes
366
+ * effect while a request is actually in flight. A token that is already
367
+ * cancelled when the send starts makes this function return that error
368
+ * immediately, and cancelling after the send has finished has no effect.
369
+ * Cancelling an in-flight send may cause the trace chunks being sent to be
370
+ * lost.
371
+ *
330
372
  * On success, if `response_out` is non-null, a heap-allocated
331
373
  * [`ExporterResponse`] is written there. The caller owns it and must
332
374
  * free it with `ddog_trace_exporter_response_free`.
333
375
  *
334
376
  * # Safety
335
377
  *
336
- * * `exporter` must be a valid `TraceExporter` pointer.
337
378
  * * `chunks` is consumed and must not be used after this call.
338
379
  * * If `response_out` is non-null it must point to valid writable memory for a
339
380
  * `Box<ExporterResponse>`.
340
381
  */
341
382
  struct ddog_TraceExporterError *ddog_trace_exporter_send_trace_chunks(const ddog_TraceExporter *exporter,
342
383
  ddog_TracerTraceChunks *chunks,
343
- struct ddog_TraceExporterResponse **response_out);
384
+ struct ddog_TraceExporterResponse **response_out,
385
+ const ddog_TraceExporterCancelToken *cancel);
344
386
 
345
387
  #ifdef __cplusplus
346
388
  } // extern "C"
@@ -488,6 +488,24 @@ struct ddog_prof_Profile_Result ddog_prof_Profile_add_endpoint_count(struct ddog
488
488
  ddog_CharSlice endpoint,
489
489
  int64_t value);
490
490
 
491
+ /**
492
+ * Set whether "local root span id" labels should be omitted when serializing.
493
+ *
494
+ * This is an experimental setting and defaults to false.
495
+ *
496
+ * # Arguments
497
+ * * `profile` - a reference to the profile being configured.
498
+ * * `omit` - true to omit the label from serialized pprof samples.
499
+ *
500
+ * # Safety
501
+ * The `profile` ptr must point to a valid Profile object created by this
502
+ * module.
503
+ * This call is _NOT_ thread-safe.
504
+ */
505
+ DDOG_CHECK_RETURN
506
+ struct ddog_prof_Profile_Result ddog_prof_Profile_set_omit_local_root_span_id_when_serializing(struct ddog_prof_Profile *profile,
507
+ bool omit);
508
+
491
509
  /**
492
510
  * Add a poisson-based upscaling rule which will be use to adjust values and make them
493
511
  * closer to reality.
@@ -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 `SharedRuntime`.
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_SharedRuntime **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_SharedRuntime *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_SharedRuntime *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_SharedRuntime *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_SharedRuntime *handle);
73
+
74
+ /**
75
+ * Shut down the `SharedRuntime`, 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_SharedRuntime *handle,
85
+ uint64_t timeout_ms);
86
+
87
+ #ifdef __cplusplus
88
+ } // extern "C"
89
+ #endif // __cplusplus
90
+
91
+ #endif /* DDOG_SHARED_RUNTIME_H */
@@ -8,7 +8,7 @@ includedir=${prefix}/include
8
8
 
9
9
  Name: datadog_profiling
10
10
  Description: Contains common code used to implement Datadog's Continuous Profilers. (Dynamic linking variant, sets rpath)
11
- Version: 35.0.0
11
+ Version: 36.0.0
12
12
  Requires:
13
13
  Libs: -L${libdir} -ldatadog_profiling -Wl,-rpath,${libdir}
14
14
  Libs.private:
@@ -429,6 +429,7 @@ target-triple,https://github.com/dtolnay/target-triple,MIT OR Apache-2.0,David T
429
429
  tempfile,https://github.com/Stebalien/tempfile,MIT OR Apache-2.0,"Steven Allen <steven@stebalien.com>, The Rust Project Developers, Ashley Mannix <ashleymannix@live.com.au>, Jason White <me@jasonwhite.io>"
430
430
  termcolor,https://github.com/BurntSushi/termcolor,Unlicense OR MIT,Andrew Gallant <jamslam@gmail.com>
431
431
  test-case-macros,https://github.com/frondeus/test-case,MIT,"Marcin Sas-Szymanski <marcin.sas-szymanski@anixe.pl>, Wojciech Polak <frondeus@gmail.com>, Łukasz Biel <lukasz.p.biel@gmail.com>"
432
+ thin-vec,https://github.com/mozilla/thin-vec,MIT OR Apache-2.0,Aria Beingessner <a.beingessner@gmail.com>
432
433
  thiserror,https://github.com/dtolnay/thiserror,MIT OR Apache-2.0,David Tolnay <dtolnay@gmail.com>
433
434
  thiserror-impl,https://github.com/dtolnay/thiserror,MIT OR Apache-2.0,David Tolnay <dtolnay@gmail.com>
434
435
  thread_local,https://github.com/Amanieu/thread_local-rs,MIT OR Apache-2.0,Amanieu d'Antras <amanieu@gmail.com>
@@ -1626,6 +1626,7 @@ typedef struct ddog_ContextKey {
1626
1626
  typedef struct ddog_TraceExporter ddog_TraceExporter;
1627
1627
  typedef struct ddog_TracerSpan ddog_TracerSpan;
1628
1628
  typedef struct ddog_TracerTraceChunks ddog_TracerTraceChunks;
1629
+ typedef struct ddog_TraceExporterCancelToken ddog_TraceExporterCancelToken;
1629
1630
 
1630
1631
 
1631
1632
  /**
@@ -2232,6 +2233,52 @@ typedef struct ddog_ffe_AttributePair {
2232
2233
  struct ddog_ffe_AttributeValue value;
2233
2234
  } ddog_ffe_AttributePair;
2234
2235
 
2236
+ /**
2237
+ * Error codes for SharedRuntime FFI operations.
2238
+ */
2239
+ typedef enum ddog_SharedRuntimeErrorCode {
2240
+ /**
2241
+ * Invalid argument provided (e.g. null handle).
2242
+ */
2243
+ DDOG_SHARED_RUNTIME_ERROR_CODE_INVALID_ARGUMENT,
2244
+ /**
2245
+ * The runtime is not available or in an invalid state.
2246
+ */
2247
+ DDOG_SHARED_RUNTIME_ERROR_CODE_RUNTIME_UNAVAILABLE,
2248
+ /**
2249
+ * Failed to acquire a lock on internal state.
2250
+ */
2251
+ DDOG_SHARED_RUNTIME_ERROR_CODE_LOCK_FAILED,
2252
+ /**
2253
+ * A worker operation failed.
2254
+ */
2255
+ DDOG_SHARED_RUNTIME_ERROR_CODE_WORKER_ERROR,
2256
+ /**
2257
+ * Failed to create the tokio runtime.
2258
+ */
2259
+ DDOG_SHARED_RUNTIME_ERROR_CODE_RUNTIME_CREATION,
2260
+ /**
2261
+ * Shutdown timed out.
2262
+ */
2263
+ DDOG_SHARED_RUNTIME_ERROR_CODE_SHUTDOWN_TIMED_OUT,
2264
+ /**
2265
+ * An unexpected panic occurred inside the FFI call.
2266
+ */
2267
+ DDOG_SHARED_RUNTIME_ERROR_CODE_PANIC,
2268
+ } ddog_SharedRuntimeErrorCode;
2269
+
2270
+ /**
2271
+ * Error returned by SharedRuntime FFI functions.
2272
+ */
2273
+ typedef struct ddog_SharedRuntimeFFIError {
2274
+ enum ddog_SharedRuntimeErrorCode code;
2275
+ /**
2276
+ * The error message is always defined when the error is returned by a ddog_shared_runtime
2277
+ * ffi.
2278
+ */
2279
+ char *msg;
2280
+ } ddog_SharedRuntimeFFIError;
2281
+
2235
2282
  typedef enum ddog_crasht_BuildIdType {
2236
2283
  DDOG_CRASHT_BUILD_ID_TYPE_GNU,
2237
2284
  DDOG_CRASHT_BUILD_ID_TYPE_GO,
@@ -170,6 +170,25 @@ struct ddog_VoidResult ddog_crasht_report_unhandled_exception(ddog_CharSlice err
170
170
  ddog_CharSlice error_message,
171
171
  struct ddog_crasht_Handle_StackTrace *runtime_stack);
172
172
 
173
+ /**
174
+ * Register the expected PID of the socket-based crash receiver
175
+ *
176
+ * When `collect_all_threads` is enabled and the receiver is reached via a Unix
177
+ * socket, the crash handler will only grant ptrace permission if the socket
178
+ * peer's PID matches this registered value.
179
+ *
180
+ * Call this after establishing a trusted connection to the sidecar
181
+ *
182
+ * # Safety
183
+ * This function is safe to call from any thread at any time.
184
+ */
185
+ void ddog_crasht_set_expected_receiver_pid(int32_t pid);
186
+
187
+ /**
188
+ * Returns the currently registered expected receiver PID, or 0 if unset.
189
+ */
190
+ int32_t ddog_crasht_get_expected_receiver_pid(void);
191
+
173
192
  /**
174
193
  * Removes all existing additional tags
175
194
  * Expected to be used after a fork, to reset the additional tags on the child
@@ -320,6 +320,38 @@ struct ddog_TraceExporterError *ddog_tracer_trace_chunks_begin_chunk(ddog_Tracer
320
320
  struct ddog_TraceExporterError *ddog_tracer_trace_chunks_push_span(ddog_TracerTraceChunks *handle,
321
321
  ddog_TracerSpan *span);
322
322
 
323
+ /**
324
+ * Create a new cancellation token.
325
+ *
326
+ * The returned token must be freed with
327
+ * [`ddog_trace_exporter_cancel_token_drop`].
328
+ */
329
+ ddog_TraceExporterCancelToken *ddog_trace_exporter_cancel_token_new(void);
330
+
331
+ /**
332
+ * Cancel a cancellation token.
333
+ *
334
+ * All clones of the same token observe the cancellation. If a
335
+ * [`ddog_trace_exporter_send_trace_chunks`] call is using this token at the
336
+ * time of cancellation, that send stops waiting for the agent at its next
337
+ * await point and returns an error; the trace chunks it was sending may be
338
+ * lost.
339
+ *
340
+ * Cancellation only affects a send that is in progress. If no send is using
341
+ * the token, cancelling it has no immediate effect: a send started afterwards
342
+ * with an already-cancelled token returns an error without contacting the
343
+ * agent, and a token cancelled after its send has already finished does
344
+ * nothing.
345
+ */
346
+ void ddog_trace_exporter_cancel_token_cancel(const ddog_TraceExporterCancelToken *token);
347
+
348
+ /**
349
+ * Free a cancellation token.
350
+ *
351
+ * After this call the token is invalid and must not be reused.
352
+ */
353
+ void ddog_trace_exporter_cancel_token_drop(ddog_TraceExporterCancelToken *token);
354
+
323
355
  /**
324
356
  * Send trace chunks through a [`TraceExporter`], consuming the chunks.
325
357
  *
@@ -327,20 +359,30 @@ struct ddog_TraceExporterError *ddog_tracer_trace_chunks_push_span(ddog_TracerTr
327
359
  * serializes in the configured output format, and sends to the agent
328
360
  * with retry logic.
329
361
  *
362
+ * When `cancel` is non-null, cancelling that token (via
363
+ * [`ddog_trace_exporter_cancel_token_cancel`]) while the send is in progress
364
+ * aborts the in-flight request and returns an error with code
365
+ * [`ExporterErrorCode::IoError`]. Cancellation is cooperative: it only takes
366
+ * effect while a request is actually in flight. A token that is already
367
+ * cancelled when the send starts makes this function return that error
368
+ * immediately, and cancelling after the send has finished has no effect.
369
+ * Cancelling an in-flight send may cause the trace chunks being sent to be
370
+ * lost.
371
+ *
330
372
  * On success, if `response_out` is non-null, a heap-allocated
331
373
  * [`ExporterResponse`] is written there. The caller owns it and must
332
374
  * free it with `ddog_trace_exporter_response_free`.
333
375
  *
334
376
  * # Safety
335
377
  *
336
- * * `exporter` must be a valid `TraceExporter` pointer.
337
378
  * * `chunks` is consumed and must not be used after this call.
338
379
  * * If `response_out` is non-null it must point to valid writable memory for a
339
380
  * `Box<ExporterResponse>`.
340
381
  */
341
382
  struct ddog_TraceExporterError *ddog_trace_exporter_send_trace_chunks(const ddog_TraceExporter *exporter,
342
383
  ddog_TracerTraceChunks *chunks,
343
- struct ddog_TraceExporterResponse **response_out);
384
+ struct ddog_TraceExporterResponse **response_out,
385
+ const ddog_TraceExporterCancelToken *cancel);
344
386
 
345
387
  #ifdef __cplusplus
346
388
  } // extern "C"
@@ -488,6 +488,24 @@ struct ddog_prof_Profile_Result ddog_prof_Profile_add_endpoint_count(struct ddog
488
488
  ddog_CharSlice endpoint,
489
489
  int64_t value);
490
490
 
491
+ /**
492
+ * Set whether "local root span id" labels should be omitted when serializing.
493
+ *
494
+ * This is an experimental setting and defaults to false.
495
+ *
496
+ * # Arguments
497
+ * * `profile` - a reference to the profile being configured.
498
+ * * `omit` - true to omit the label from serialized pprof samples.
499
+ *
500
+ * # Safety
501
+ * The `profile` ptr must point to a valid Profile object created by this
502
+ * module.
503
+ * This call is _NOT_ thread-safe.
504
+ */
505
+ DDOG_CHECK_RETURN
506
+ struct ddog_prof_Profile_Result ddog_prof_Profile_set_omit_local_root_span_id_when_serializing(struct ddog_prof_Profile *profile,
507
+ bool omit);
508
+
491
509
  /**
492
510
  * Add a poisson-based upscaling rule which will be use to adjust values and make them
493
511
  * closer to reality.
@@ -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 `SharedRuntime`.
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_SharedRuntime **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_SharedRuntime *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_SharedRuntime *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_SharedRuntime *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_SharedRuntime *handle);
73
+
74
+ /**
75
+ * Shut down the `SharedRuntime`, 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_SharedRuntime *handle,
85
+ uint64_t timeout_ms);
86
+
87
+ #ifdef __cplusplus
88
+ } // extern "C"
89
+ #endif // __cplusplus
90
+
91
+ #endif /* DDOG_SHARED_RUNTIME_H */
@@ -8,7 +8,7 @@ includedir=${prefix}/include
8
8
 
9
9
  Name: datadog_profiling
10
10
  Description: Contains common code used to implement Datadog's Continuous Profilers. (Dynamic linking variant, sets rpath)
11
- Version: 35.0.0
11
+ Version: 36.0.0
12
12
  Requires:
13
13
  Libs: -L${libdir} -ldatadog_profiling -Wl,-rpath,${libdir}
14
14
  Libs.private:
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libdatadog
3
3
  version: !ruby/object:Gem::Version
4
- version: 35.0.0.1.0
4
+ version: 36.0.0.1.0
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - Datadog, Inc.
@@ -26,38 +26,40 @@ files:
26
26
  - rust-toolchain.toml
27
27
  - tasks/build.rake
28
28
  - tasks/gem.rake
29
- - vendor/libdatadog-35.0.0/x86_64-linux-musl/LICENSE
30
- - vendor/libdatadog-35.0.0/x86_64-linux-musl/LICENSE-3rdparty.csv
31
- - vendor/libdatadog-35.0.0/x86_64-linux-musl/NOTICE
32
- - vendor/libdatadog-35.0.0/x86_64-linux-musl/bin/libdatadog-crashtracking-receiver
33
- - vendor/libdatadog-35.0.0/x86_64-linux-musl/include/datadog/blazesym.h
34
- - vendor/libdatadog-35.0.0/x86_64-linux-musl/include/datadog/common.h
35
- - vendor/libdatadog-35.0.0/x86_64-linux-musl/include/datadog/crashtracker.h
36
- - vendor/libdatadog-35.0.0/x86_64-linux-musl/include/datadog/data-pipeline.h
37
- - vendor/libdatadog-35.0.0/x86_64-linux-musl/include/datadog/ddsketch.h
38
- - vendor/libdatadog-35.0.0/x86_64-linux-musl/include/datadog/ffe.h
39
- - vendor/libdatadog-35.0.0/x86_64-linux-musl/include/datadog/library-config.h
40
- - vendor/libdatadog-35.0.0/x86_64-linux-musl/include/datadog/log.h
41
- - vendor/libdatadog-35.0.0/x86_64-linux-musl/include/datadog/profiling.h
42
- - vendor/libdatadog-35.0.0/x86_64-linux-musl/include/datadog/telemetry.h
43
- - vendor/libdatadog-35.0.0/x86_64-linux-musl/lib/libdatadog_profiling.so
44
- - vendor/libdatadog-35.0.0/x86_64-linux-musl/lib/pkgconfig/datadog_profiling_with_rpath.pc
45
- - vendor/libdatadog-35.0.0/x86_64-linux/LICENSE
46
- - vendor/libdatadog-35.0.0/x86_64-linux/LICENSE-3rdparty.csv
47
- - vendor/libdatadog-35.0.0/x86_64-linux/NOTICE
48
- - vendor/libdatadog-35.0.0/x86_64-linux/bin/libdatadog-crashtracking-receiver
49
- - vendor/libdatadog-35.0.0/x86_64-linux/include/datadog/blazesym.h
50
- - vendor/libdatadog-35.0.0/x86_64-linux/include/datadog/common.h
51
- - vendor/libdatadog-35.0.0/x86_64-linux/include/datadog/crashtracker.h
52
- - vendor/libdatadog-35.0.0/x86_64-linux/include/datadog/data-pipeline.h
53
- - vendor/libdatadog-35.0.0/x86_64-linux/include/datadog/ddsketch.h
54
- - vendor/libdatadog-35.0.0/x86_64-linux/include/datadog/ffe.h
55
- - vendor/libdatadog-35.0.0/x86_64-linux/include/datadog/library-config.h
56
- - vendor/libdatadog-35.0.0/x86_64-linux/include/datadog/log.h
57
- - vendor/libdatadog-35.0.0/x86_64-linux/include/datadog/profiling.h
58
- - vendor/libdatadog-35.0.0/x86_64-linux/include/datadog/telemetry.h
59
- - vendor/libdatadog-35.0.0/x86_64-linux/lib/libdatadog_profiling.so
60
- - vendor/libdatadog-35.0.0/x86_64-linux/lib/pkgconfig/datadog_profiling_with_rpath.pc
29
+ - vendor/libdatadog-36.0.0/x86_64-linux-musl/LICENSE
30
+ - vendor/libdatadog-36.0.0/x86_64-linux-musl/LICENSE-3rdparty.csv
31
+ - vendor/libdatadog-36.0.0/x86_64-linux-musl/NOTICE
32
+ - vendor/libdatadog-36.0.0/x86_64-linux-musl/bin/libdatadog-crashtracking-receiver
33
+ - vendor/libdatadog-36.0.0/x86_64-linux-musl/include/datadog/blazesym.h
34
+ - vendor/libdatadog-36.0.0/x86_64-linux-musl/include/datadog/common.h
35
+ - vendor/libdatadog-36.0.0/x86_64-linux-musl/include/datadog/crashtracker.h
36
+ - vendor/libdatadog-36.0.0/x86_64-linux-musl/include/datadog/data-pipeline.h
37
+ - vendor/libdatadog-36.0.0/x86_64-linux-musl/include/datadog/ddsketch.h
38
+ - vendor/libdatadog-36.0.0/x86_64-linux-musl/include/datadog/ffe.h
39
+ - vendor/libdatadog-36.0.0/x86_64-linux-musl/include/datadog/library-config.h
40
+ - vendor/libdatadog-36.0.0/x86_64-linux-musl/include/datadog/log.h
41
+ - vendor/libdatadog-36.0.0/x86_64-linux-musl/include/datadog/profiling.h
42
+ - vendor/libdatadog-36.0.0/x86_64-linux-musl/include/datadog/shared-runtime.h
43
+ - vendor/libdatadog-36.0.0/x86_64-linux-musl/include/datadog/telemetry.h
44
+ - vendor/libdatadog-36.0.0/x86_64-linux-musl/lib/libdatadog_profiling.so
45
+ - vendor/libdatadog-36.0.0/x86_64-linux-musl/lib/pkgconfig/datadog_profiling_with_rpath.pc
46
+ - vendor/libdatadog-36.0.0/x86_64-linux/LICENSE
47
+ - vendor/libdatadog-36.0.0/x86_64-linux/LICENSE-3rdparty.csv
48
+ - vendor/libdatadog-36.0.0/x86_64-linux/NOTICE
49
+ - vendor/libdatadog-36.0.0/x86_64-linux/bin/libdatadog-crashtracking-receiver
50
+ - vendor/libdatadog-36.0.0/x86_64-linux/include/datadog/blazesym.h
51
+ - vendor/libdatadog-36.0.0/x86_64-linux/include/datadog/common.h
52
+ - vendor/libdatadog-36.0.0/x86_64-linux/include/datadog/crashtracker.h
53
+ - vendor/libdatadog-36.0.0/x86_64-linux/include/datadog/data-pipeline.h
54
+ - vendor/libdatadog-36.0.0/x86_64-linux/include/datadog/ddsketch.h
55
+ - vendor/libdatadog-36.0.0/x86_64-linux/include/datadog/ffe.h
56
+ - vendor/libdatadog-36.0.0/x86_64-linux/include/datadog/library-config.h
57
+ - vendor/libdatadog-36.0.0/x86_64-linux/include/datadog/log.h
58
+ - vendor/libdatadog-36.0.0/x86_64-linux/include/datadog/profiling.h
59
+ - vendor/libdatadog-36.0.0/x86_64-linux/include/datadog/shared-runtime.h
60
+ - vendor/libdatadog-36.0.0/x86_64-linux/include/datadog/telemetry.h
61
+ - vendor/libdatadog-36.0.0/x86_64-linux/lib/libdatadog_profiling.so
62
+ - vendor/libdatadog-36.0.0/x86_64-linux/lib/pkgconfig/datadog_profiling_with_rpath.pc
61
63
  homepage: https://docs.datadoghq.com/tracing/
62
64
  licenses:
63
65
  - Apache-2.0