-
-
Notifications
You must be signed in to change notification settings - Fork 32
feat(sidecar): Auto capture stdio logs as Sentry log events #1044
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
When using `spotlight run` if the process is not using Sentry SDK with logs integration, we lose all its logging output that comes to stdout/stderr. This change automatically captures that output checks against any log items we receive from the process on the sidecar and sends them as Sentry log events only if we cannot get any logs from our integration.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
| logger.debug("Detected Sentry logging in the process, disabling stdio relay"); | ||
| relayStdioAsLogs = false; | ||
| // Return false to skip this log (prevent duplicate) | ||
| return false; | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| return true; | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: fuzzySearcher starts empty, causing relayStdioAsLogs to remain true if SDK logs arrive first.
Severity: HIGH | Confidence: 0.90
🔍 Detailed Analysis
The fuzzySearcher is initialized empty. If Sentry SDK logs are received by the sidecar via the /stream endpoint before any stdout/stderr data has been processed and added to the searcher, the fuzzySearcher.search() operation will not find any matches. This prevents the relayStdioAsLogs flag from being correctly set to false, leading to continued duplication of logs where both stdout/stderr and SDK logs are sent.
💡 Suggested Fix
Ensure fuzzySearcher is populated with initial stdout/stderr data before processing SDK logs, or delay SDK log processing. Alternatively, initialize relayStdioAsLogs to false and only set it to true if no SDK logs are detected.
🤖 Prompt for AI Agent
Fix this bug. In packages/sidecar/src/cli/run.ts at lines 91-134: The `fuzzySearcher` is
initialized empty. If Sentry SDK logs are received by the sidecar via the `/stream`
endpoint before any stdout/stderr data has been processed and added to the searcher, the
`fuzzySearcher.search()` operation will not find any matches. This prevents the
`relayStdioAsLogs` flag from being correctly set to `false`, leading to continued
duplication of logs where both stdout/stderr and SDK logs are sent.
Did we get this right? 👍 / 👎 to inform future reviews.
betegon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great one! one step closer to a great spotlight run
This pull request contains changes generated by Cursor background composer. <a href="https://cursor.com/background-agent?bcId=bc-b09007dd-6ca4-4563-9fe2-fef7f79fff99"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/open-in-cursor-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/open-in-cursor-light.svg"><img alt="Open in Cursor" src="https://cursor.com/open-in-cursor.svg"></picture></a> <a href="https://cursor.com/agents?id=bc-b09007dd-6ca4-4563-9fe2-fef7f79fff99"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/open-in-web-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/open-in-web-light.svg"><img alt="Open in Web" src="https://cursor.com/open-in-web.svg"></picture></a> --------- Co-authored-by: Cursor Agent <[email protected]>
This pull request contains changes generated by Cursor background composer. <a href="https://cursor.com/background-agent?bcId=bc-0b99054c-93b8-4ef8-8721-e278a246eab4"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/open-in-cursor-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/open-in-cursor-light.svg"><img alt="Open in Cursor" src="https://cursor.com/open-in-cursor.svg"></picture></a> <a href="https://cursor.com/agents?id=bc-0b99054c-93b8-4ef8-8721-e278a246eab4"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/open-in-web-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/open-in-web-light.svg"><img alt="Open in Web" src="https://cursor.com/open-in-web.svg"></picture></a> --------- Co-authored-by: Cursor Agent <[email protected]>
betegon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's go. loved the new comments you added btw.
All Cursor 😅 |
When using
spotlight runif the process is not using Sentry SDKwith logs integration, we lose all its logging output that comes
to stdout/stderr. This change automatically captures that output
checks against any log items we receive from the process on the
sidecar and sends them as Sentry log events only if we cannot
get any logs from our integration.
Note: mostly vibe-coded