Conversation
derive a log category - FATAL, ERROR, WARN, INFO, DEBUG, TRACE for each ingested log records first map severity_number directory to a category fallback where severity_number is unset (0 / UNSPECIFIED), scan the log body to find category based on case-insensitive substring match defaults to UNSPECIFIED when neither rules yields a result
WalkthroughAdds formatting-only trailing commas to HTTP routing builders and extends OpenTelemetry log processing with a new known field Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/otel/logs.rs`:
- Around line 178-181: Move the insertion of "p_log_category" so it occurs after
the call to insert_attributes to prevent client-provided attributes from
overwriting the server-derived value; locate the log_record_json.insert(...) for
"p_log_category" in src/otel/logs.rs and the insert_attributes(...) call in
src/otel/otel_utils.rs, remove the earlier insertion and re-insert
"p_log_category" immediately after insert_attributes returns (preserving the
same unwrap_or("UNSPECIFIED") behavior) so the server-set key wins.
ℹ️ Review info
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (3)
src/handlers/http/modal/query_server.rssrc/handlers/http/modal/server.rssrc/otel/logs.rs
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/otel/logs.rs (1)
102-114: Body fallback substring matching is prone to false positives.Current partial-match logic can misclassify (
"terror"→ERROR,"debugger"→DEBUG). Consider token-boundary matching for better category precision.Also applies to: 163-174
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/otel/logs.rs` around lines 102 - 114, The substring match in contains_ignore_ascii_case used by category_from_body is causing false positives; change the matching to require token/word-boundary matches (case-insensitive) instead of arbitrary substring windows: replace the byte-windows approach with a word-boundary-aware check (e.g., regex with \b or tokenize the body and compare whole tokens) when scanning LOG_CATEGORIES patterns so patterns only match full words; apply the same change to the duplicate logic referenced later in the file (the other occurrence that mirrors contains_ignore_ascii_case/category_from_body).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/otel/logs.rs`:
- Around line 102-114: The substring match in contains_ignore_ascii_case used by
category_from_body is causing false positives; change the matching to require
token/word-boundary matches (case-insensitive) instead of arbitrary substring
windows: replace the byte-windows approach with a word-boundary-aware check
(e.g., regex with \b or tokenize the body and compare whole tokens) when
scanning LOG_CATEGORIES patterns so patterns only match full words; apply the
same change to the duplicate logic referenced later in the file (the other
occurrence that mirrors contains_ignore_ascii_case/category_from_body).
derive a log category - FATAL, ERROR, WARN, INFO, DEBUG, TRACE for each ingested log records
first map severity_number directory to a category
fallback where severity_number is unset (0 / UNSPECIFIED),
scan the log body to find category based on case-insensitive substring match
defaults to UNSPECIFIED when neither rules yields a result
Summary by CodeRabbit
New Features
Style