Skip to content

Enhance log module and enhance address resolver in access log module#213

Merged
mrproliu merged 2 commits into
apache:mainfrom
mrproliu:enhance-fix
Jul 15, 2026
Merged

Enhance log module and enhance address resolver in access log module#213
mrproliu merged 2 commits into
apache:mainfrom
mrproliu:enhance-fix

Conversation

@mrproliu

Copy link
Copy Markdown
Contributor

No description provided.

@mrproliu mrproliu added this to the 0.8.0 milestone Jul 15, 2026
@mrproliu
mrproliu requested a review from Copilot July 15, 2026 12:53
@mrproliu mrproliu added the enhancement New feature or request label Jul 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_modules allowlist 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.

Comment thread pkg/accesslog/common/connection.go
Comment thread pkg/tools/netns/netns.go
@mrproliu
mrproliu merged commit 9ea70d3 into apache:main Jul 15, 2026
28 checks passed
@mrproliu
mrproliu deleted the enhance-fix branch July 15, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants