feat: Add advanced observability features: stack traces, lock contention, s… #22
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add Advanced Observability Features
This PR introduces comprehensive new observability capabilities to podtrace, significantly enhancing its diagnostic and troubleshooting capabilities.
New Features
Stack Trace Capture for Slow Operations
addr2linefor human-readable diagnosticsLock Contention & Synchronization Tracking
do_futexkprobeTCP Retransmission & Network Error Tracking
tcp_retransmit_skbtracepointnet_dev_xmittracepointExtended Syscall Tracing
execveviado_execveat_commonkprobefork/cloneviasched_process_forktracepointopen/openatviado_sys_openat2kprobecloseoperations (when available)Database Query Tracing
PQexecuprobe (libpq)mysql_real_queryuprobe (libmysqlclient)Technical Improvements
BPF Stack Overflow Fix
struct eventwith per-CPU array map (event_buf)stack_buf)MAX_STACK_DEPTHfrom 64 to 32 to optimize memory usageNew BPF Maps
stack_traces: Stores completed stack tracesevent_buf: Per-CPU temporary event storagestack_buf: Per-CPU temporary stack trace storagelock_targets: Stores lock identifiers for contention trackingdb_queries: Stores sanitized database query patternssyscall_paths: Stores file paths for syscall operationsNew Event Types
EVENT_LOCK_CONTENTION: Lock contention eventsEVENT_TCP_RETRANS: TCP retransmission eventsEVENT_NET_DEV_ERROR: Network device error eventsEVENT_DB_QUERY: Database query eventsEVENT_EXEC: Process execution eventsEVENT_FORK: Process/thread creation eventsEVENT_OPEN: File open eventsEVENT_CLOSE: File close eventsDiagnostic Enhancements
New Report Sections
Enhanced Filtering
procfilter option for process lifecycle events--filterflag to support:dns,net,fs,cpu,proc--filter net,proc)Breaking Changes
None - all changes are backward compatible.