Conversation
Config validation (4.1): - TLS file existence check via os.Stat - OTLP endpoint host:port format validation - Log level validation against known levels - Timeout vs shutdown duration sanity check DebugLogInterceptor wiring: - Add DisableDebugLogInterceptor and DebugLogHeaderName config fields - Wire to interceptors in processConfig - Update getCustomHeaderMatcher to variadic headers for HTTP support Also adds goleak.VerifyTestMain for goroutine leak detection.
Address review: use os.IsNotExist for "not found" vs general "could not be accessed" with error details. Add TestGetCustomHeaderMatcher_MultipleHeaders for variadic header matching.
Clarify that GRPCMaxSendMsgSize limits response size FROM the service and GRPCMaxRecvMsgSize limits request size TO the service. Separate per-field comments. Regenerate READMEs via make doc.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (8)
📝 WalkthroughWalkthroughThis PR adds configuration-driven control for debug logging interceptors via two new config fields ( Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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.
Pull request overview
This PR updates the generated documentation around gRPC max send/recv message size semantics, and also introduces additional runtime/config/test changes in the core package (config validation enhancements, HTTP header forwarding updates, and goroutine leak checking).
Changes:
- Clarify
GRPCMaxSendMsgSize(response) vsGRPCMaxRecvMsgSize(request) field documentation and regenerate READMEs. - Extend HTTP→gRPC metadata header forwarding to support multiple exact-match headers (trace + debug-log header) and add related config plumbing.
- Add
goleak-basedTestMainand expandConfig.Validate()checks with accompanying tests; bump related dependencies.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Regenerated gomarkdoc output (updated symbol links/line refs). |
| config/README.md | Regenerated config docs; clarifies gRPC send/recv size comments and documents new debug-log config fields. |
| config/config.go | Adds debug-log config fields; clarifies gRPC send/recv size semantics; expands Validate() with TLS file, OTLP endpoint, log level, and timing checks. |
| config/config_test.go | Adds tests covering the new Validate() warnings. |
| core.go | Wires new debug-log config into interceptors; updates header matcher to accept multiple exact headers; forwards debug-log header through grpc-gateway. |
| core_test.go | Adds test for multi-header matching behavior. |
| goleak_test.go | Adds package-level TestMain to detect goroutine leaks with a set of ignore rules. |
| go.mod | Bumps internal dependencies and adds go.uber.org/goleak. |
| go.sum | Updates checksums for bumped/added dependencies. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if c.config.DisableDebugLogInterceptor { | ||
| interceptors.SetDisableDebugLogInterceptor(true) | ||
| } | ||
| if c.config.DebugLogHeaderName != "" { | ||
| interceptors.SetDebugLogHeaderName(c.config.DebugLogHeaderName) | ||
| } |
There was a problem hiding this comment.
The PR title/description says this is a docs-only clarification, but this hunk introduces new runtime behavior (new config flags affecting interceptor behavior) and is coupled with other non-doc changes in the PR (goleak TestMain, config validation additions, dependency bumps). Please update the PR title/description to reflect the functional changes, or split the functional changes into a separate PR to keep review scope clear.
There was a problem hiding this comment.
Recreated PR as #76 with clean branch from main — only the doc/comment changes. The previous branch had stale commits from the prior PR.
| for _, prefix := range prefixes { | ||
| if len(prefix) > 0 && strings.HasPrefix(key, strings.ToLower(prefix)) { | ||
| return key, true |
There was a problem hiding this comment.
getCustomHeaderMatcher lowercases each configured prefix on every header match attempt (strings.ToLower(prefix) inside the per-request matcher). Since this function runs for every inbound HTTP header, consider normalizing prefixes once (similar to lowerHeaders) to avoid repeated work on hot paths.
There was a problem hiding this comment.
Good catch — fixed in #76. Prefixes are now normalized once at init alongside headers.
Summary
GRPCMaxSendMsgSizelimits response size from the service andGRPCMaxRecvMsgSizelimits request size to the servicemake docTest plan
make testpassesmake lintcleanmake docrun, READMEs updatedSummary by CodeRabbit
New Features
Chores