Skip to content

feat(monitors-run): capture and report command output on failure#3359

Open
shurizzle wants to merge 1 commit into
getsentry:masterfrom
shurizzle:cron-output
Open

feat(monitors-run): capture and report command output on failure#3359
shurizzle wants to merge 1 commit into
getsentry:masterfrom
shurizzle:cron-output

Conversation

@shurizzle

Copy link
Copy Markdown

Description

Capture stdout/stderr from failed commands in sentry-cli monitors run and 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.

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.
@shurizzle shurizzle requested review from a team and szokeasaurusrex as code owners July 6, 2026 23:50

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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()));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 80176a6. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants