Skip to content

Commit b9da34b

Browse files
committed
bump libdatadog
1 parent b33ea57 commit b9da34b

9 files changed

Lines changed: 333 additions & 107 deletions

File tree

Cargo.lock

Lines changed: 264 additions & 93 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: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,6 +1388,14 @@ typedef struct ddog_crasht_Slice_CInt {
13881388
uintptr_t len;
13891389
} ddog_crasht_Slice_CInt;
13901390

1391+
/**
1392+
* Represents an object that should only be referred to by its handle.
1393+
* Do not access its member for any reason, only use the C API functions on this struct.
1394+
*/
1395+
typedef struct ddog_crasht_Handle_StackTrace {
1396+
struct ddog_crasht_StackTrace *inner;
1397+
} ddog_crasht_Handle_StackTrace;
1398+
13911399
/**
13921400
* A generic result type for when an operation may fail,
13931401
* or may return <T> in case of success.
@@ -1493,14 +1501,6 @@ typedef struct ddog_crasht_Span {
14931501
ddog_CharSlice thread_name;
14941502
} ddog_crasht_Span;
14951503

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-
15041504
typedef struct ddog_crasht_ThreadData {
15051505
bool crashed;
15061506
ddog_CharSlice name;
@@ -1875,6 +1875,13 @@ void ddog_endpoint_set_timeout(struct ddog_Endpoint *endpoint, uint64_t millis);
18751875

18761876
void ddog_endpoint_set_test_token(struct ddog_Endpoint *endpoint, ddog_CharSlice token);
18771877

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

18801887
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/ddtrace.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ bool ddog_remote_configs_service_env_change(struct ddog_RemoteConfigState *remot
8080
ddog_CharSlice service,
8181
ddog_CharSlice env,
8282
ddog_CharSlice version,
83-
const struct ddog_Vec_Tag *tags);
83+
const struct ddog_Vec_Tag *tags,
84+
const struct ddog_Vec_Tag *process_tags);
8485

8586
bool ddog_remote_config_alter_dynamic_config(struct ddog_RemoteConfigState *remote_config,
8687
ddog_CharSlice config,

components-rs/remote_config.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,12 +494,14 @@ pub extern "C" fn ddog_remote_configs_service_env_change(
494494
env: CharSlice,
495495
version: CharSlice,
496496
tags: &libdd_common_ffi::Vec<Tag>,
497+
process_tags: &libdd_common_ffi::Vec<Tag>,
497498
) -> bool {
498499
let new_target = Target {
499500
service: service.to_utf8_lossy().to_string(),
500501
env: env.to_utf8_lossy().to_string(),
501502
app_version: version.to_utf8_lossy().to_string(),
502503
tags: tags.as_slice().to_vec(),
504+
process_tags: process_tags.as_slice().to_vec(),
503505
};
504506

505507
if let Some(target) = remote_config.manager.get_target() {

ext/sidecar.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,8 +529,9 @@ void ddtrace_sidecar_submit_root_span_data_direct(ddog_SidecarTransport **transp
529529
ddog_CharSlice version_slice = dd_zend_string_to_CharSlice(version_string);
530530

531531
bool changed = true;
532+
struct ddog_Vec_Tag process_tags = ddog_Vec_Tag_new();
532533
if (DDTRACE_G(remote_config_state)) {
533-
changed = ddog_remote_configs_service_env_change(DDTRACE_G(remote_config_state), service_slice, env_slice, version_slice, &DDTRACE_G(active_global_tags));
534+
changed = ddog_remote_configs_service_env_change(DDTRACE_G(remote_config_state), service_slice, env_slice, version_slice, &DDTRACE_G(active_global_tags), &process_tags);
534535
if (!changed && root) {
535536
// ddog_remote_configs_service_env_change() generally only processes configs if they changed. However, upon request initialization it may be identical to the previous request.
536537
// However, at request shutdown some configs are unloaded. Explicitly forcing a processing step ensures these are re-loaded.

libdatadog

Submodule libdatadog updated 186 files

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 (($payload["is_crash"] ?? false) !== true) {
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)