Enhance log module and enhance address resolver in access log module#213
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR strengthens access-log destination resolution (especially for Ambient Istio ztunnel) and improves logging controllability/observability by adding targeted debug-module allowlisting and richer resolution statistics.
Changes:
- Add redundant ztunnel correlation sources (new uprobe source, admin config-dump/metrics polling in ztunnel netns, and access-log tailing fallback) and defer flushing briefly while resolution is pending.
- Add resolution/conntrack success/miss counters and periodic summaries to diagnose unresolved “raw service IP” cases and mapping latency.
- Add logger
debug_modulesallowlist to enable debug logs for selected modules without raising the global log level.
Reviewed changes
Copilot reviewed 24 out of 25 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/tools/netns/netns.go | New helper to run code inside a target network namespace and restore afterwards. |
| pkg/tools/netns/netns_test.go | Tests covering error paths, same-namespace behavior, and switching into a distinct netns. |
| pkg/tools/ip/tcpresolver.go | Adds ConnTrackResolved flag to track conntrack rewrite success on socket pairs. |
| pkg/tools/ip/conntrack.go | Adds atomic counters and StatsString() for conntrack resolve success/miss observability. |
| pkg/tools/host/file.go | Adds host-mapping resolver for /var/log/pods to support log tailing inside the agent container. |
| pkg/tools/btf/linker.go | Exposes UProbeExeFile.Found() so callers can detect silent no-op link additions. |
| pkg/process/finders/kubernetes/template.go | Treats initContainers as candidates for sidecar detection (native sidecar cases). |
| pkg/logger/settings.go | Adds debug_modules config parsing and applies allowlist to pre-created loggers. |
| pkg/logger/logger.go | Introduces dual-root loggers and registry rebind to selectively elevate modules to debug. |
| pkg/logger/logger_test.go | Tests for debug allowlist behavior and re-apply of config to pre-created loggers. |
| pkg/accesslog/runner.go | Defers log flushing when connection resolution is still pending. |
| pkg/accesslog/common/connection.go | Adds bounded resolution deferral logic, resolution stats, periodic unresolved summaries, and retro-resolve push path. |
| pkg/accesslog/common/connection_resolution_test.go | Unit tests for ShouldDeferForResolution deadline/grace behavior. |
| pkg/accesslog/collector/ztunnel.go | Major ztunnel correlation enhancements: new uprobe source, larger perf buffers, per-source stats, plausibility guards, retro-resolve push, and non-fatal attach handling. |
| pkg/accesslog/collector/ztunnel_resolution_test.go | Unit tests for IsResolutionPending behavior. |
| pkg/accesslog/collector/ztunnel_flush_test.go | Unit tests for mapping attachment behavior and plausibility checks. |
| pkg/accesslog/collector/ztunnel_admin.go | New admin config-dump + metrics polling inside ztunnel netns for symbol-independent mapping and cross-checks. |
| pkg/accesslog/collector/ztunnel_accesslog.go | New access-log tailing fallback from kubelet pod logs as last-resort mapping source. |
| pkg/accesslog/collector/ztunnel_accesslog_test.go | Unit tests for access-log parsing across CRI and docker json-file formats. |
| pkg/accesslog/collector/connection.go | Ignores failed accept events with negative fd; marks conntrack-resolved connections; removes ineffective kprobe link. |
| configs/rover_configs.yaml | Adds logger.debug_modules configuration option. |
| CHANGES.md | Release notes for new ztunnel fallbacks, stats, and bug fixes. |
| bpf/accesslog/syscalls/connect_conntrack.c | Fixes always-true condition and removes unused ctnetlink_fill_info hook. |
| bpf/accesslog/ambient/ztunnel.c | Adds AArch64/x86 arg handling for sret-shifted args and new uprobe for ConnectionResult::new. |
| .gitignore | Updates ignored paths for .omc/.config directories. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
wu-sheng
approved these changes
Jul 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.