feat(monitors-run): capture and report command output on failure#3359
feat(monitors-run): capture and report command output on failure#3359shurizzle wants to merge 1 commit into
Conversation
Add --with-output flag to 'monitors run'. On failure, captured stdout and stderr is sent as a Sentry error event with monitor context, enabling debugging of failed checks directly in Sentry.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 80176a6. Configure here.
| log::info!("Continuing to exit with program's exit code..."); | ||
| let mut monitor_ctx = BTreeMap::new(); | ||
| monitor_ctx.insert("id".into(), Value::String(monitor_slug.to_owned())); | ||
| monitor_ctx.insert("check_in_id".into(), Value::String(check_in_id.to_string())); |
There was a problem hiding this comment.
Mismatched check in ID format
Medium Severity
Failure events put check_in_id in monitor context as a hyphenated UUID string, while send_checkin_with_trace sends the same id in check-in envelopes as 32 hex characters without hyphens. Sentry may not associate the error event with the failing check-in.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 80176a6. Configure here.


Description
Capture stdout/stderr from failed commands in
sentry-cli monitors runand attach to check-in.Issues
Legal Boilerplate
Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.