[superlog] Log batch_union fallback as WARN instead of ERROR#513
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 |
|
Clean replacement for #502, rebased onto current What changed:
Local verification passed:
|
|
The latest updates on your projects. Learn more about Unkey Deploy
|
| log.warn({ | ||
| service: "api", | ||
| error_message: err.message, | ||
| ...(err.stack ? { error_stack: err.stack } : {}), | ||
| ...(payload ?? {}), | ||
| }); |
There was a problem hiding this comment.
captureWarning's fallback path includes error_stack in the structured log object, but the sibling captureError function's fallback log.error call does not. This means a recovered warning ends up with more stack context in the fallback logger than a genuine error, which inverts expectations and could make error triage harder when the request logger is absent.
| log.warn({ | |
| service: "api", | |
| error_message: err.message, | |
| ...(err.stack ? { error_stack: err.stack } : {}), | |
| ...(payload ?? {}), | |
| }); | |
| log.warn({ | |
| service: "api", | |
| error_message: err.message, | |
| ...(payload ?? {}), | |
| }); |
Summary
captureWarninghelper for recovered AI warningsSupersedes #502 with a clean branch from current
staging.Verification
Summary by cubic
Logs recovered batch_union fallbacks as WARN instead of ERROR to reduce noise while keeping context. Adds a request-aware captureWarning and preserves fallback metadata on the warning event.
Written for commit 6dfcd52. Summary will update on new commits.