feat(observability): optional error reporting to GlitchTip via Sentry#81
Conversation
Adds an opt-in error reporter (issue #70). @sentry/node is an optional dependency, dynamically imported only when a DSN (AITM_SENTRY_DSN / SENTRY_DSN) is configured, so the default path — and runtimes without the SDK (e.g. Deno) — load nothing and pay nothing. The CLI entrypoint captures + flushes an uncaught crash before exit; any init/SDK failure degrades to a no-op so observability never breaks a run. Live verification (an error appearing in the GlitchTip project) is gated on the project + DSN from infrastructure#478. Refs #70
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 44 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds an optional Sentry/GlitchTip error reporting module ( ChangesOptional Sentry Error Reporting
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/aitm/docs/observability.md`:
- Line 26: The observability docs currently promise that reporting never affects
exit code, but the CLI path in cli.ts still awaits reporter.flush() on both
exits without handling rejections. Either update the wording in observability.md
to narrow the guarantee, or harden the cli.ts exit flow so reporter failures are
caught and ignored before process termination, keeping the promise accurate.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 68935e85-9fe2-4bce-a89d-5e6a18abe657
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (5)
packages/aitm/docs/observability.mdpackages/aitm/package.jsonpackages/aitm/src/cli/cli.tspackages/aitm/src/observability/error-reporter.test.tspackages/aitm/src/observability/error-reporter.ts
… the run Per review: the real reporter now swallows SDK errors in captureException/flush, so a failing Sentry transport can't surface to the CLI exit path — keeping the docs guarantee that reporting never affects the exit code accurate.
|
@coderabbitai review |
✅ Action performedReview finished.
|
## What Adds `.mcp.json` pointing Claude at the GlitchTip MCP endpoint, completing the app-repo side of the per-app GlitchTip rollout for ai-task-master. - Infra ticket: `developerz-ai/infrastructure#504` - App ticket: `#70` · Epic: `developerz-ai/infrastructure#476` ## Context The Sentry → GlitchTip error reporter already landed in #81 (`src/observability/error-reporter.ts`, wired into the CLI entrypoint, DSN from `AITM_SENTRY_DSN`/`SENTRY_DSN`, optional dep, no-op when unset). The only remaining committed artifact per the rollout was this `.mcp.json`. ## Scope notes - Repo-level dev-tooling config — **not** part of the published npm package (`files` allowlist), so no release is warranted by this change. - The remaining acceptance item — a live deliberate-error test landing in the ai-task-master GlitchTip project + `#errors` — is owner-executed and gated on the standalone DSN being provisioned. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added configuration for a new MCP server connection, enabling the app to connect to the `glitchtip` service via HTTP. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: marshall <marshall@developerz.ai>
Summary
Opt-in error reporting (issue #70).
@sentry/nodeis an optional dependency, dynamically imported only when a DSN is configured — so the default path, and runtimes without the SDK (e.g. Deno), load nothing and pay nothing.Changes
src/observability/error-reporter.ts—dsnFromEnv(AITM_SENTRY_DSN > SENTRY_DSN, blank = unset) +initErrorReporter(dynamic@sentry/node, no-op fallback on missing SDK / init failure).src/cli/cli.ts— entrypoint captures + flushes an uncaught crash before exit.packages/aitm/package.json—@sentry/nodeinoptionalDependencies.docs/observability.md— env vars + behaviour.Testing
src/observability/error-reporter.test.ts: DSN precedence/blank handling; no-DSN → safe no-op (never throws, never loads the SDK). Full suite green (675);build,biome,tscclean.Note
Live verification (an error landing in the GlitchTip project) is gated on the project + DSN from infrastructure#478.
Refs #70
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Tests