Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
6b294ab
[#186]: added trace_cpu_frequency and trace_cpu_idle tracepoints in m…
LorenzoTettamanti Jun 14, 2026
936b5d8
[#186]: added cpu frequency tracer user space functions to read the d…
LorenzoTettamanti Jun 14, 2026
f240ff9
[#186]: updated metrics.yaml kubernetes manifest. Added tracefs path …
LorenzoTettamanti Jun 14, 2026
9802b0d
(feat): added memory tracing in kernel space using sys_enter_mmap tr…
LorenzoTettamanti Jun 20, 2026
ce341e5
(feat: #186): added cpu_bytes_alloc_events_total, cpy_bytes_alloc mem…
LorenzoTettamanti Jun 20, 2026
12ae5b5
(feat : #186): added userspace consumer for memory allocation events.…
LorenzoTettamanti Jun 20, 2026
fc158c8
(feat: #186) : Added scheduler tracing metrics (sched_stat_wait,sched…
LorenzoTettamanti Jun 21, 2026
84ca27f
(feat: #186) : added userspace consumer for scheduler metrics
LorenzoTettamanti Jun 21, 2026
c8141f4
(example): added grafana dashboard example
LorenzoTettamanti Jun 22, 2026
85b2884
[#186]: Added cpu idle metrics in kernel space
LorenzoTettamanti Jun 22, 2026
86c88ef
[#186]: added userspace consumer for the cpu idle events
LorenzoTettamanti Jun 22, 2026
f244487
(example): Added docker example(only metrics). improved dashboard tem…
LorenzoTettamanti Jul 3, 2026
46cdb15
[#186]: fixed typo in cpu.rs
LorenzoTettamanti Jul 3, 2026
845c5c4
(chores): updated metrics image
LorenzoTettamanti Jul 3, 2026
fabdc00
(fix): fixed grafana version
LorenzoTettamanti Jul 10, 2026
7dda5d6
(refactor): refactored network tracing using a network.rs module
LorenzoTettamanti Jul 11, 2026
46f33b8
(refactor): changed NetworkMetrics data structure name to PacketLossM…
LorenzoTettamanti Jul 11, 2026
02222ae
(fix): fixed subtle bug occurring. changed way to return pid and tgid…
LorenzoTettamanti Jul 11, 2026
0d30ead
(refactor): updated consumer userspace API with the latest kernel sp…
LorenzoTettamanti Jul 11, 2026
47708df
(refactor): updated metrics/main.rs with the latest metrics_tracer ch…
LorenzoTettamanti Jul 11, 2026
dfe2d33
(metrics): updated metrics semantics to better represent the metrics …
LorenzoTettamanti Jul 11, 2026
6c84220
Merge branch '0.1.5' into metrics-patch
LorenzoTettamanti Jul 11, 2026
09dea56
(fix): fixed typo in build-local-metrics
LorenzoTettamanti Jul 12, 2026
b91f832
(fix): fixed typos introduced during the merge
LorenzoTettamanti Jul 12, 2026
97ddf52
[#201]: added semantic.rs
LorenzoTettamanti Jul 13, 2026
bb373a6
(cleaning): removed deprecated code. Fixed uppercase enum variant wit…
LorenzoTettamanti Jul 15, 2026
353d991
[#186]: Histogram<u64> distributions for sched_stat_wait and sched_st…
LorenzoTettamanti Jul 16, 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
46 changes: 23 additions & 23 deletions core/common/src/buffer_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ pub const TASK_COMM_LEN: usize = 16; // linux/sched.h
#[cfg(feature = "monitoring-structs")]
#[repr(C, packed)]
#[derive(Clone, Copy, Zeroable)]
pub struct NetworkMetrics {
pub struct PacketLossMetrics {
pub tgid: u32,
pub comm: [u8; TASK_COMM_LEN],
pub ts_us: u64,
Expand All @@ -108,7 +108,7 @@ pub struct NetworkMetrics {
pub sk_drops: i32, // Offset 136
}
#[cfg(feature = "monitoring-structs")]
unsafe impl aya::Pod for NetworkMetrics {}
unsafe impl aya::Pod for PacketLossMetrics {}

#[cfg(feature = "monitoring-structs")]
#[repr(C, packed)]
Expand Down Expand Up @@ -208,7 +208,7 @@ pub enum BufferType {
#[cfg(feature = "network-structs")]
VethLog,
#[cfg(feature = "monitoring-structs")]
NetworkMetrics,
PacketLossMetrics,
#[cfg(feature = "monitoring-structs")]
TimeStampMetrics,
#[cfg(feature = "monitoring-structs")]
Expand Down Expand Up @@ -436,7 +436,7 @@ impl BufferType {
///
/// Counterpart to [`read_network_buffer`] for the `time_stamp_events` map.

pub async fn read_network_metrics(
pub async fn read_packet_loss_metrics(
buffers: &mut [BytesMut],
tot_events: i32,
offset: i32,
Expand All @@ -445,7 +445,7 @@ impl BufferType {
) {
for i in offset..tot_events {
let vec_bytes = &buffers[i as usize];
if vec_bytes.len() < std::mem::size_of::<NetworkMetrics>() {
if vec_bytes.len() < std::mem::size_of::<PacketLossMetrics>() {
error!(
"Corrupted Network Metrics data. Raw data: {}. Readed {} bytes expected {} bytes",
vec_bytes
Expand All @@ -454,28 +454,28 @@ impl BufferType {
.collect::<Vec<_>>()
.join(" "),
vec_bytes.len(),
std::mem::size_of::<NetworkMetrics>()
std::mem::size_of::<PacketLossMetrics>()
);
continue;
}
if vec_bytes.len() >= std::mem::size_of::<NetworkMetrics>() {
let net_metrics: NetworkMetrics =
if vec_bytes.len() >= std::mem::size_of::<PacketLossMetrics>() {
let packet_loss: PacketLossMetrics =
unsafe { std::ptr::read_unaligned(vec_bytes.as_ptr() as *const _) };

match exporter {
"otlp" => metrics.record_network_metrics(&net_metrics),
"otlp" => metrics.record_packet_loss_metrics(&packet_loss),
_ => continue, // skip
}
let tgid = net_metrics.tgid;
let comm = String::from_utf8_lossy(&net_metrics.comm);
let ts_us = net_metrics.ts_us;
let sk_drop_count = net_metrics.sk_drops;
let sk_err = net_metrics.sk_err;
let sk_err_soft = net_metrics.sk_err_soft;
let sk_backlog_len = net_metrics.sk_backlog_len;
let sk_write_memory_queued = net_metrics.sk_write_memory_queued;
let sk_ack_backlog = net_metrics.sk_ack_backlog;
let sk_receive_buffer_size = net_metrics.sk_receive_buffer_size;
let tgid = packet_loss.tgid;
let comm = String::from_utf8_lossy(&packet_loss.comm);
let ts_us = packet_loss.ts_us;
let sk_drop_count = packet_loss.sk_drops;
let sk_err = packet_loss.sk_err;
let sk_err_soft = packet_loss.sk_err_soft;
let sk_backlog_len = packet_loss.sk_backlog_len;
let sk_write_memory_queued = packet_loss.sk_write_memory_queued;
let sk_ack_backlog = packet_loss.sk_ack_backlog;
let sk_receive_buffer_size = packet_loss.sk_receive_buffer_size;

info!(
"tgid: {}, comm: {}, ts_us: {}, sk_drops: {}, sk_err: {}, sk_err_soft: {}, sk_backlog_len: {}, sk_write_memory_queued: {}, sk_ack_backlog: {}, sk_receive_buffer_size: {}",
Expand Down Expand Up @@ -811,15 +811,15 @@ pub async fn read_perf_buffer<T: std::borrow::BorrowMut<aya::maps::MapData>>(
.await
}
#[cfg(feature = "monitoring-structs")]
BufferType::NetworkMetrics => {
BufferType::read_network_metrics(
BufferType::PacketLossMetrics => {
BufferType::read_packet_loss_metrics(
&mut buffers,
tot_events,
offset,
"otlp",
metrics
.clone()
.expect("Metrics required for NetworkMetrics"),
.expect("Metrics required for PacketLossMetrics"),
)
.await
}
Expand Down Expand Up @@ -939,7 +939,7 @@ impl BufferSize {
#[cfg(feature = "network-structs")]
BufferSize::TcpEvents => std::mem::size_of::<TcpPacketRegistry>(),
#[cfg(feature = "monitoring-structs")]
BufferSize::NetworkMetricsEvents => std::mem::size_of::<NetworkMetrics>(),
BufferSize::NetworkMetricsEvents => std::mem::size_of::<PacketLossMetrics>(),
#[cfg(feature = "monitoring-structs")]
BufferSize::TimeMetricsEvents => std::mem::size_of::<TimeStampMetrics>(),
#[cfg(feature = "monitoring-structs")]
Expand Down
1 change: 1 addition & 0 deletions core/common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ pub mod map_handlers;
pub mod otel_metrics;
#[cfg(feature = "program-handlers")]
pub mod program_handlers;
mod semantic;
Loading