Skip to content

Commit 8221b6f

Browse files
committed
Update libdatadog
Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
1 parent b33ea57 commit 8221b6f

8 files changed

Lines changed: 332 additions & 358 deletions

File tree

Cargo.lock

Lines changed: 264 additions & 339 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components-rs/common.h

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -429,13 +429,10 @@ typedef struct ddog_RemoteConfigState ddog_RemoteConfigState;
429429
typedef struct ddog_SidecarActionsBuffer ddog_SidecarActionsBuffer;
430430

431431
/**
432-
* `SidecarTransport` is a wrapper around a BlockingTransport struct from the `datadog_ipc` crate
433-
* that handles transparent reconnection.
434-
* It is used for sending `SidecarInterfaceRequest` and receiving `SidecarInterfaceResponse`.
432+
* `SidecarTransport` wraps a [`SidecarInterfaceChannel`] with transparent reconnection support.
435433
*
436434
* This transport is used for communication between different parts of the sidecar service.
437-
* It is a blocking transport, meaning that it will block the current thread until the operation is
438-
* complete.
435+
* It is a blocking transport (all operations block the current thread).
439436
*/
440437
typedef struct ddog_SidecarTransport ddog_SidecarTransport;
441438

@@ -1388,6 +1385,14 @@ typedef struct ddog_crasht_Slice_CInt {
13881385
uintptr_t len;
13891386
} ddog_crasht_Slice_CInt;
13901387

1388+
/**
1389+
* Represents an object that should only be referred to by its handle.
1390+
* Do not access its member for any reason, only use the C API functions on this struct.
1391+
*/
1392+
typedef struct ddog_crasht_Handle_StackTrace {
1393+
struct ddog_crasht_StackTrace *inner;
1394+
} ddog_crasht_Handle_StackTrace;
1395+
13911396
/**
13921397
* A generic result type for when an operation may fail,
13931398
* or may return <T> in case of success.
@@ -1493,14 +1498,6 @@ typedef struct ddog_crasht_Span {
14931498
ddog_CharSlice thread_name;
14941499
} ddog_crasht_Span;
14951500

1496-
/**
1497-
* Represents an object that should only be referred to by its handle.
1498-
* Do not access its member for any reason, only use the C API functions on this struct.
1499-
*/
1500-
typedef struct ddog_crasht_Handle_StackTrace {
1501-
struct ddog_crasht_StackTrace *inner;
1502-
} ddog_crasht_Handle_StackTrace;
1503-
15041501
typedef struct ddog_crasht_ThreadData {
15051502
bool crashed;
15061503
ddog_CharSlice name;
@@ -1875,6 +1872,13 @@ void ddog_endpoint_set_timeout(struct ddog_Endpoint *endpoint, uint64_t millis);
18751872

18761873
void ddog_endpoint_set_test_token(struct ddog_Endpoint *endpoint, ddog_CharSlice token);
18771874

1875+
/**
1876+
* Set whether to use the system DNS resolver when building the reqwest client.
1877+
* If false, the default in-process resolver is used.
1878+
*/
1879+
void ddog_endpoint_set_use_system_resolver(struct ddog_Endpoint *endpoint,
1880+
bool use_system_resolver);
1881+
18781882
void ddog_endpoint_drop(struct ddog_Endpoint*);
18791883

18801884
struct ddog_Option_U32 ddog_Option_U32_some(uint32_t v);

components-rs/crashtracker.h

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,45 @@ struct ddog_VoidResult ddog_crasht_init_without_receiver(struct ddog_crasht_Conf
131131
*/
132132
struct ddog_crasht_Slice_CInt ddog_crasht_default_signals(void);
133133

134+
/**
135+
* Report an unhandled exception as a crash event.
136+
*
137+
* This function sends a crash report for an unhandled exception detected
138+
* by the runtime. It is intended to be called when the process is in a
139+
* terminal state due to an unhandled exception.
140+
*
141+
* # Parameters
142+
* - `error_type`: Optional type/class of the exception (e.g. "NullPointerException"). Pass empty
143+
* CharSlice for unknown.
144+
* - `error_message`: Optional error message. Pass empty CharSlice for no message.
145+
* - `runtime_stack`: Stack trace from the runtime. Consumed by this call.
146+
*
147+
* If the crash-tracker has not been initialized, this function is a no-op.
148+
*
149+
* # Side effects
150+
* This function disables the signal-based crash handler before performing
151+
* any work. This means that if the process receives a fatal signal (SIGSEGV)
152+
* during or after this call, the crashtracker will not produce a
153+
* second crash report. The previous signal handler (if any) will still be
154+
* chained.
155+
*
156+
* # Failure mode
157+
* If a fatal signal occurs while this function is in progress, the calling
158+
* process is in an unrecoverable state; the crashtracker cannot report the
159+
* secondary fault and the caller's own signal handler (if any) will execute
160+
* in a potentially corrupted context. Callers should treat this function as a
161+
* terminal operation and exit shortly after it returns.
162+
*
163+
* # Safety
164+
* Crash-tracking functions are not reentrant.
165+
* No other crash-handler functions should be called concurrently.
166+
* The `runtime_stack` handle must be valid and will be consumed.
167+
*/
168+
DDOG_CHECK_RETURN
169+
struct ddog_VoidResult ddog_crasht_report_unhandled_exception(ddog_CharSlice error_type,
170+
ddog_CharSlice error_message,
171+
struct ddog_crasht_Handle_StackTrace *runtime_stack);
172+
134173
/**
135174
* Removes all existing additional tags
136175
* Expected to be used after a fork, to reset the additional tags on the child
@@ -661,7 +700,12 @@ struct ddog_VoidResult ddog_crasht_CrashInfoBuilder_with_thread_name(struct ddog
661700
* The `builder` can be null, but if non-null it must point to a Builder made by this module,
662701
* which has not previously been dropped.
663702
* All arguments must be valid.
664-
* This method requires that the builder has a UUID and metadata set
703+
* This method requires that the builder has `metadata` and `kind` set
704+
* Applications can add `message` or `sig_info` to the builder to provide additional context.
705+
* If set, the data will be used to derive the crash ping message in the order of
706+
* - an explicit message set with `with_message`
707+
* - sig_info set with `with_sig_info`
708+
* - kind set with `with_kind`
665709
*/
666710
DDOG_CHECK_RETURN
667711
struct ddog_VoidResult ddog_crasht_CrashInfoBuilder_upload_ping_to_endpoint(struct ddog_crasht_Handle_CrashInfoBuilder *builder,

components-rs/sidecar.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ ddog_MaybeError ddog_sidecar_session_set_config(struct ddog_SidecarTransport **t
194194
uintptr_t force_drop_size,
195195
ddog_CharSlice log_level,
196196
ddog_CharSlice log_path,
197-
void *remote_config_notify_function,
197+
void *_remote_config_notify_function,
198198
const enum ddog_RemoteConfigProduct *remote_config_products,
199199
uintptr_t remote_config_products_count,
200200
const enum ddog_RemoteConfigCapabilities *remote_config_capabilities,

libdatadog

Submodule libdatadog updated 271 files

tests/ext/background-sender/agent_sampling_sidecar.phpt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ function checkUpdated($marker) {
3737
}
3838
}
3939
}
40-
usleep(100000);
40+
$fn = "us" . "leep"; // do not retry
41+
$fn(100000);
4142
} while (--$retries);
4243
foreach (glob("/dev/shm/*") as $f) {
4344
var_dump($f, bin2hex(file_get_contents($f)));

tests/ext/crashtracker_segfault.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ $rr->waitForRequest(function ($request) {
5151
if (!isset($payload["message"]["metadata"])) {
5252
break;
5353
}
54-
if (($payload["message"]["kind"] ?? "") == "Crash ping") {
54+
if (!isset($payload["message"]["os_info"])) {
5555
continue;
5656
}
5757

tests/ext/live-debugger/debugger_span_decoration_probe.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ array(2) {
9898
["_dd.di.ret.probe_id"]=>
9999
string(1) "3"
100100
}
101-
string(%d) "/debugger/v1/input?ddtags=debugger_version:1.%s,env:none,version:,runtime_id:%s-%s-%s-%s-%s,host_name:%s"
101+
string(%d) "/debugger/v1/diagnostics?ddtags=debugger_version:1.%s,env:none,version:,runtime_id:%s-%s-%s-%s-%s,host_name:%s"
102102
array(1) {
103103
[0]=>
104104
array(6) {

0 commit comments

Comments
 (0)