In this lesson, you will learn how to identify visibility gaps by mapping the boundaries between hardware, the kernel, and user-space processes.
The Observability Blind Spots
When troubleshooting performance, we often default to checking high-level metrics like CPU load or memory usage. However, as an advanced engineer, you must recognize that observability is not a monolithic feature; it is a stack. A gap occurs when an event happens at a layer below what your tools are instrumenting.
Mapping the Layers
- Hardware/Firmware: This is the bedrock. If your CPU is throttling due to thermal limits or your NIC is experiencing hardware-level buffer drops, standard Linux tools might report "high latency" but won't explain why. These events are often silent to the kernel unless specifically exposed via Performance Monitoring Units (PMUs).
- Kernel/Subsystem: This is where context switches, interrupt handlers, and syscall overhead live. If a process is blocked on I/O, the kernel knows if it’s waiting on disk hardware (disk latency) or queued in a bottleneck (I/O scheduler contention). If you aren’t using eBPF or tracepoints to hook into these transitions, you are guessing about kernel-level blockages.
- User-space: This includes your runtime, libraries, and application code. An observability gap here often involves "stolen time" where the kernel or hypervisor prevents the process from executing, even if the application code itself is efficient.
Identifying the Gap
Consider a scenario where an application reports high latency during a specific system call. To determine where the gap exists, you must correlate the duration of the syscall (Kernel) with the application's execution state (User-space) and the underlying hardware queues.
If you rely solely on /proc/stat or top, you only see the user-space/kernel interface. You are blind to the hardware transition. You can verify this gap by using a tool that triggers on a specific tracepoint to compare the time a syscall is requested versus when the hardware interrupt confirms completion:
# Example of tracing a potential gap in block device latency
sudo bpftrace -e 'tracepoint:block:block_rq_issue { @start[tid] = nsecs; }
tracepoint:block:block_rq_complete /@start[tid]/ {
printf("Latency: %d ns\n", nsecs - @start[tid]); delete(@start[tid]); }'
If your toolset shows high latency here, but your application-level APM shows no slow functions, you have successfully identified that the observability gap resides in the kernel’s interaction with the storage subsystem.
Key Takeaway: Observability gaps arise when your instrumentation layer fails to capture the state transitions between hardware, the kernel, and user-space; true visibility requires correlating metrics across all three strata.