Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
82333dc
feat(sidecar): track Data Streams Monitoring backlogs in shared memory
arjunguhaswe Oct 21, 2026
64abf7d
Merge remote-tracking branch 'origin/arjun.guha/dsm-shm-table' into a…
arjunguhaswe Oct 24, 2026
8a1bc50
fix(ipc): adapt the DSM backlog schema to ShmSafe and the product-les…
arjunguhaswe Oct 24, 2026
eb3fd7e
Merge branch 'arjun.guha/dsm-shm-table' into arjun.guha/dsm2-450-php-…
arjunguhaswe Oct 25, 2026
27c2bf0
perf(ipc): shrink the DSM backlog table to 128 slots
arjunguhaswe Oct 25, 2026
52c0f49
Merge branch 'arjun.guha/dsm-shm-table' into arjun.guha/dsm2-450-php-…
arjunguhaswe Oct 25, 2026
275bb3a
Merge remote-tracking branch 'origin/arjun.guha/dsm-shm-table' into a…
arjunguhaswe Oct 27, 2026
5ea6f73
refactor(ipc): drop DSM backlogs whose tag values do not resolve
arjunguhaswe Oct 27, 2026
c692385
Merge remote-tracking branch 'origin/arjun.guha/dsm-shm-table' into a…
arjunguhaswe Oct 27, 2026
d47ba93
Merge remote-tracking branch 'origin/arjun.guha/dsm-shm-table' into a…
arjunguhaswe Oct 27, 2026
ab49c8b
refactor(ipc): hash DSM backlog tags with their derived Hash
arjunguhaswe Oct 29, 2026
95a3026
refactor(ipc): derive BacklogTag's iteration, count and keys with strum
arjunguhaswe Oct 29, 2026
df084d2
docs(ipc): say up front what BacklogTag's discriminant indexes
arjunguhaswe Oct 29, 2026
99ebcba
Merge branch 'arjun.guha/dsm-shm-table' into arjun.guha/dsm2-450-php-…
arjunguhaswe Oct 29, 2026
fe0ed3a
fix(sidecar): signal the backlog table before unlinking it when the c…
arjunguhaswe Oct 30, 2026
3e3a8a7
docs(ipc): note the races a forced drain accepts
arjunguhaswe Oct 30, 2026
968dc08
docs(ipc): keep the forced-drain note to forced drains
arjunguhaswe Oct 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

78 changes: 76 additions & 2 deletions datadog-sidecar/src/service/blocking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,26 @@ pub fn add_dsm_checkpoint(
Ok(transport.with_retry(|s| s.send(&request)))
}

/// IPC fallback for DSM backlogs. Returns whether the offset was sent, as
/// [`add_dsm_checkpoint`] does.
pub fn add_dsm_backlog(
transport: &mut SidecarTransport,
env: String,
version: String,
service: String,
primary_tag: String,
backlog: libdd_ipc::shm_dsm_backlog::OwnedDsmBacklog,
) -> io::Result<bool> {
let request = SidecarInterfaceRequest::AddDsmBacklog {
env,
version,
service,
primary_tag,
backlog,
};
Ok(transport.with_retry(|s| s.send(&request)))
}

/// Starts the AppSec backend in the sidecar and waits for initialization to
/// complete before returning.
pub fn ensure_appsec_started(
Expand Down Expand Up @@ -624,8 +644,8 @@ mod tests {
use super::try_submit_ffe;
use crate::service::SidecarAction;
use crate::service::blocking::{
SidecarTransport, add_dsm_checkpoint, add_span_to_concentrator, enqueue_actions,
send_dogstatsd_actions,
SidecarTransport, add_dsm_backlog, add_dsm_checkpoint, add_span_to_concentrator,
enqueue_actions, send_dogstatsd_actions,
};
use crate::service::ffe_submission::FfeSubmissionStatus;
use crate::service::sidecar_interface::{
Expand Down Expand Up @@ -946,6 +966,60 @@ mod tests {
assert!(!send(&mut transport));
}

#[test]
#[cfg_attr(miri, ignore)]
fn dsm_backlog_fallback_reports_whether_the_offset_was_sent() {
use libdd_ipc::shm_dsm_backlog::BacklogTag;
let (conn, peer) = SeqpacketConn::socketpair().unwrap();
let mut transport = SidecarTransport::from(conn);
transport
.set_read_timeout(Some(Duration::from_millis(100)))
.unwrap();
let send = |transport: &mut SidecarTransport| {
add_dsm_backlog(
transport,
"env".into(),
"v1".into(),
"svc".into(),
"".into(),
libdd_ipc::shm_dsm_backlog::OwnedDsmBacklog {
tags: vec![
(BacklogTag::Topic, "orders".into()),
(BacklogTag::Type, "kafka_produce".into()),
],
offset: 42,
},
)
.unwrap()
};
assert!(send(&mut transport));
let mut buf = [0; 1024];
let (len, _) = peer.try_recv_raw(&mut buf).unwrap();
match libdd_ipc::codec::decode::<SidecarInterfaceRequest>(&buf[..len]).unwrap() {
SidecarInterfaceRequest::AddDsmBacklog {
env,
service,
backlog,
..
} => {
assert_eq!(env, "env");
assert_eq!(service, "svc");
assert_eq!(
backlog.tags,
[
(BacklogTag::Topic, "orders".to_owned()),
(BacklogTag::Type, "kafka_produce".to_owned()),
]
);
assert_eq!(backlog.offset, 42);
}
_ => panic!("expected a DSM backlog"),
}

drop(peer);
assert!(!send(&mut transport));
}

/// Decodes all requests sent to `peer` so far.
fn received(peer: &SeqpacketConn) -> Vec<SidecarInterfaceRequest> {
let mut buf = vec![0; libdd_ipc::max_message_size()];
Expand Down
Loading
Loading