fix: stitch multi-line stack traces into one log event in observability-logs-openobserve - #281
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughFluent Bit’s Kubernetes log pipeline now applies application-level multiline parsing for Go, Java, Python, and .NET stack traces, buffering records for up to 2000ms and combining recognized continuation lines. ChangesMultiline stack-trace processing
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant TailInput as Fluent Bit tail input
participant MultilineFilter as multiline filter
participant Parser as Built-in or dotnet parser
participant OpenObserve
TailInput->>MultilineFilter: Send kube.* log records
MultilineFilter->>Parser: Parse multiline content from log key
Parser-->>MultilineFilter: Return combined stack trace
MultilineFilter->>OpenObserve: Forward combined log record
Possibly related issues
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 `@observability-logs-openobserve/helm/templates/fluent-bit/config.yaml`:
- Around line 89-90: Update the continuation regex in the “cont” rule to require
a word boundary or whitespace after “at” (for example, `at\s` or `\bat\b`),
while preserving the existing `--- End of` matching.
🪄 Autofix (Beta)
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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 016b99f0-4aee-41b8-ba3b-011b13be9a4f
📒 Files selected for processing (1)
observability-logs-openobserve/helm/templates/fluent-bit/config.yaml
…ty-logs-openobserve The tail input only set 'multiline.parser docker, cri', which handles the container-runtime partial-line protocol but never concatenates application lines belonging to one stack trace, so each frame reached OpenObserve as its own record with its own inferred level. Add an application-level multiline filter (go, java, python built-ins plus a custom dotnet parser) between the tail input and the kubernetes filter, and document in parsers.conf how to extend the parser list for formats not covered by the built-ins. Signed-off-by: Tem Revil <temrevil@gmail.com>
3e003b8 to
aa31194
Compare
…egex CodeRabbit flagged that the cont rule's alternation "at|--- End of" matches "at" as a bare substring, so any continuation line starting with a word like "atomic" or "attribute" (not just a stack frame " at ...") would also be folded into the same multiline record. Require a space after "at" so only actual stack-frame lines match. Signed-off-by: Tem Revil <temrevil@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Purpose
Multi-line exceptions (a .NET
FluentValidation.ValidationException, or a Java/Go/Python stack trace) emitted by a workload are shipped to OpenObserve as one record per physical line instead of one record per exception, so a single error is scattered across many records and continuation lines get inconsistent log levels. Fixes openchoreo/openchoreo#4150.Approach
Follows the proposed fix in the issue, and mirrors #280 (the same fix for the opensearch module) so the sibling modules stay consistent:
multilinefilter between thetailinput and thekubernetesfilter, keyed onlogcontent, using the built-ingo, java, pythonparsers plus a customdotnetparser (buffer On,flush_ms 2000).dotnet[MULTILINE_PARSER]inparsers.conf— Fluent Bit has no built-in .NET parser. A comment documents how to add further custom parsers for formats the built-ins don't cover.Verification
dotnetrules against a representativeFluentValidation.ValidationExceptiontrace: the…Exception: …line matchesstart_stateonly, theat …/--- End of inner exception stack trace ---lines matchcontonly, and a following normal log line matches neither — so the exception is stitched into one record (level taken from the first line) and the next record starts cleanly.tail → multiline → kubernetes → http.Summary by CodeRabbit