[APIP] Traffic-logging fixes - #3192
Conversation
📝 WalkthroughWalkthroughThe translator now enables access logs for stdout or collector ALS independently. It builds file and gRPC sinks separately. gRPC access logs always exclude reserved gateway health paths and can also exclude configured path prefixes. ChangesAccess log sink activation and assembly
gRPC access-log filtering
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Listener
participant AccessLogConfig
participant HCM
participant CollectorALS
Listener->>AccessLogConfig: enable stdout or collector ALS
AccessLogConfig->>HCM: attach configured access-log sinks
AccessLogConfig->>CollectorALS: apply health-path and ignore-prefix filters
CollectorALS-->>HCM: emit permitted request logs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@gateway/gateway-controller/pkg/xds/translator.go`:
- Around line 2641-2647: Update the caller around createGRPCAccessLog so its
error is returned when the collector is enabled and stdout logging is disabled,
instead of continuing with an empty accessLogs list; preserve the existing
warning-and-continue behavior when stdout logging remains available. Add a
regression test covering an invalid collector buffer size in collector-only mode
and assert the listener creation propagates the configuration error.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 2723fe11-ac18-416b-9b1a-88f7bccd2873
📒 Files selected for processing (2)
gateway/gateway-controller/pkg/xds/translator.gogateway/gateway-controller/pkg/xds/translator_test.go
Fixes https://github.com/wso2-enterprise/wso2-apim-internal/issues/18544 and https://github.com/wso2-enterprise/wso2-apim-internal/issues/18541
This doesn't address the issue of the gateway-health probe request being sent to datadog