Repository navigation
Conversation
…p-dual-send Send discovery agent errors to GlitchTip as well as Sentry (WEB-6914)
vigneshsubbiah16
left a comment
There was a problem hiding this comment.
✅ Security consensus: no issues found. (reviewers: Claude, Semgrep, Gitleaks)
🤖 consensus review · reviewers: Claude, Semgrep, Gitleaks · head 80c73b11 · 2026-11-30T05:41Z
| finally: | ||
| glitchtip_timeout = event_timeout if max_seconds is None else int( | ||
| min(event_timeout, max_seconds - (time.monotonic() - post_started))) | ||
| _copy_event_to_glitchtip(tmp_path, glitchtip_timeout, priority) |
There was a problem hiding this comment.
P1 · Keep GlitchTip active when Sentry is unavailable (codex)
After three consecutive Sentry transport failures, subsequent non-priority events return before the GlitchTip copy is attempted. A healthy GlitchTip therefore stops receiving discovery errors for the rest of the run when Sentry is blocked or unavailable.
The Sentry breaker returns at utils.py:3723-3724 before the GlitchTip call at utils.py:3784. Sentry transport failures trip that breaker at utils.py:3793-3798, while GlitchTip has its own separate failure counter at utils.py:3667-3680.
…p-dual-send
Send discovery agent errors to GlitchTip as well as Sentry (WEB-6914)
Unbound Review · Score 3/5 (1 P1) ·
80c73b1_post_sentry_event. It then copies every event sent to Sentry to a self-hosted GlitchTip DSN, which has its own consecutive-failure circuit breaker (stops sending after repeated failures) and stays inside the caller'smax_secondsbudget. Setting AI_DISCOVERY_SENTRY_DSN turns the copy off, and tests/init now sets that variable to empty so test runs never send real events. The logic is correcfindings: 0 P0 · 1 P1 · 2 P2 (top 5 P0/P1 inline) · engines: codex ✅ · claude ✅
Findings not posted inline
tests/test_discovery_flow.py:824Use localhost servers for HTTP tests — The new GlitchTip tests mock subprocess.run for curl requests instead of exercising a real local HTTP server. (codex)scripts/coding_discovery_tools/utils.py:3723GlitchTip copy stops whenever the Sentry breaker trips — The GlitchTip copy only runs after the Sentry-side checks pass. Once_sentry_dead_this_runis set after 3 failed Sentry posts,report_to_sentryreturns early and GlitchTip gets nothing more for the rest of the run, except priority events. On a customer network that blocks ingest.us.sentry.io but (claude)rules applied: CLAUDE.md