Skip to content

Commit

Permalink
Send frame location info in exception replay log
Browse files Browse the repository at this point in the history
Signed-off-by: Bob Weinand <[email protected]>
  • Loading branch information
bwoebi committed Sep 27, 2024
1 parent b459aa2 commit f28ae7d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
4 changes: 2 additions & 2 deletions ddcommon-ffi/src/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@ impl<T> Vec<T> {
pub fn as_slice(&self) -> Slice<T> {
unsafe { Slice::from_raw_parts(self.ptr, self.len) }
}

pub const fn new() -> Self {
Vec {
ptr: NonNull::dangling().as_ptr(),
len: 0,
capacity: 0,
_marker: PhantomData,
}
}
}
}

impl<T> Deref for Vec<T> {
Expand Down
21 changes: 19 additions & 2 deletions live-debugger-ffi/src/send_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ use std::mem::transmute;
use crate::data::Probe;
use datadog_live_debugger::debugger_defs::{
Capture as DebuggerCaptureAlias, Capture, Captures, DebuggerData, DebuggerPayload, Diagnostics,
DiagnosticsError, Entry, Fields, ProbeStatus, Snapshot, SnapshotEvaluationError,
Value as DebuggerValueAlias,
DiagnosticsError, Entry, Fields, ProbeMetadata, ProbeMetadataLocation, ProbeStatus, Snapshot,
SnapshotEvaluationError, Value as DebuggerValueAlias,
};
use datadog_live_debugger::sender::generate_new_id;
use datadog_live_debugger::{
Expand Down Expand Up @@ -94,6 +94,8 @@ pub extern "C" fn ddog_create_exception_snapshot<'a>(
exception_id: CharSlice<'a>,
exception_hash: CharSlice<'a>,
frame_index: u32,
type_name: CharSlice<'a>,
method_name: CharSlice<'a>,
timestamp: u64,
) -> *mut DebuggerCapture<'a> {
let snapshot = DebuggerPayload {
Expand All @@ -106,6 +108,21 @@ pub extern "C" fn ddog_create_exception_snapshot<'a>(
r#return: Some(Capture::default()),
..Default::default()
}),
probe: Some(ProbeMetadata {
id: Default::default(),
location: ProbeMetadataLocation {
method: if method_name.is_empty() {
None
} else {
Some(method_name.to_utf8_lossy())
},
r#type: if type_name.is_empty() {
None
} else {
Some(type_name.to_utf8_lossy())
},
},
}),
language: language.to_utf8_lossy(),
id: id.to_utf8_lossy(),
exception_capture_id: Some(exception_id.to_utf8_lossy()),
Expand Down
2 changes: 1 addition & 1 deletion sidecar/src/service/session_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ impl SessionInfo {
}
);
} else {
warn!("Did not find queue_id {queue_id:?} for runtime id {runtime_id} od session id {} - skipping live debugger data", self.session_id);
warn!("Did not find queue_id {queue_id:?} for runtime id {runtime_id} of session id {} - skipping live debugger data", self.session_id);
}
} else {
warn!(
Expand Down
2 changes: 1 addition & 1 deletion sidecar/src/shm_remote_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ mod tests {

// just one update
assert!(matches!(manager.fetch_update(), RemoteConfigUpdate::None));

manager.unload_configs(&[PATH_FIRST.product]);

if let RemoteConfigUpdate::Add { value, .. } = manager.fetch_update() {
Expand Down

0 comments on commit f28ae7d

Please sign in to comment.