Skip to content

feat(observability): add self-host Sentry monitors - #1860

Merged
JSONbored merged 1 commit into
JSONbored:mainfrom
oktofeesh1:codex/sentry-cron-monitors
Jun 30, 2026
Merged

feat(observability): add self-host Sentry monitors#1860
JSONbored merged 1 commit into
JSONbored:mainfrom
oktofeesh1:codex/sentry-cron-monitors

Conversation

@oktofeesh1

Copy link
Copy Markdown
Contributor

Summary

  • Add opt-in Sentry cron monitor check-ins for the self-host scheduled loop, Orb export loop, and pull-mode Orb relay drain.
  • Move recurring monitor wiring into a tested self-host helper so relay ack behavior and monitor contexts are covered directly.
  • Document the emitted monitors in the self-host operations website docs.

Closes #1733

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked an issue, or this is small enough that the summary explains why an issue is not needed.

Validation

  • npm run test:ci
  • npm audit --audit-level=moderate
  • Direct lcov check: src/selfhost/sentry.ts covered 138/138 lines and 141/141 branches.
  • Direct lcov check: src/selfhost/monitored-work.ts covered 14/14 lines and 9/9 branches.
  • New behavior has unit tests for monitor success/failure, sanitizer boundaries, disabled mode, scheduled loop context, Orb export logging, and Orb relay ack invariants.

If any required check was skipped, explain why:

  • None.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests.
  • API/OpenAPI/MCP behavior is updated and tested where needed.
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks.
  • Visible UI changes include a UI Evidence section below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs.

UI Evidence

Text-only self-host operations documentation update; no runtime product UI state changed.

State / title JPG/PNG evidence
Text-only docs copy Not applicable

Notes

  • Sentry monitor check-ins are inert unless SENTRY_DSN is configured.
  • src/server.ts remains thin live-process wiring around the covered helper module so global tests do not need to import the self-host server entrypoint.

@loopover-orb

loopover-orb Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Tip

🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩

✅ Gittensory review result - approve/merge recommended

Review updated: 2026-06-30 10:54:36 UTC

6 files · 1 AI reviewer · no blockers · readiness 60/100 · CI green · unknown

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
The change cleanly centralizes self-host recurring work behind a Sentry monitor wrapper and preserves the existing scheduled loop, export, and relay-drain behavior in the visible paths. The relay ack state transition matches the prior server implementation, and the new tests cover enabled/disabled monitor behavior, slug normalization, context sanitization, success/failure check-ins, and ack invariants. The most notable remaining issue is maintainability: the monitor schedules are hard-coded in `src/selfhost/sentry.ts` and not documented with the operational cadence they encode, but that is not a functional break in this diff.

Nits — 5 non-blocking
  • nit: `src/selfhost/sentry.ts:27` hard-codes the three monitor schedules without a short comment tying each value to the actual timer cadence in `src/server.ts`, so future cadence changes can drift silently.
  • nit: `src/selfhost/monitored-work.ts:53` passes `args.state.pendingAck` directly into `drain`, so a mutating `drain` implementation could corrupt the state before this helper clears it; passing a shallow copy would make the helper more defensive.
  • In `src/selfhost/sentry.ts:27`, add a brief comment near `SENTRY_MONITORS` stating these schedules must stay aligned with the self-host timers in `src/server.ts`.
  • In `src/selfhost/monitored-work.ts:53`, consider calling `args.drain(args.relayEnv, [...args.state.pendingAck])` so the helper owns its ack state regardless of the drain implementation.
  • Readiness score is below the configured threshold — Use the readiness panel as advisory maintainer context; the score does not block this PR.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #1733
Related work ⚠️ 3 scoped overlaps Top overlaps are listed below; lower-confidence bulk is hidden.
Change scope ❌ 8/20 High review scope from cached public metadata (size label size:L; 1 linked issue).
Validation posture ❌ 5/25 Preflight is holding this PR; address the blocker before review.
Contributor workload ✅ 10/10 Author activity: 67 registered-repo PR(s), 56 merged, 7 issue(s).
Contributor context ✅ Confirmed Gittensor contributor oktofeesh1; Gittensor profile; 67 PR(s), 7 issue(s).
Gate result ✅ Passing No configured blocker found.
Review context
Contributor next steps
  • Review top overlaps.
  • Add a concise scope and risk note.
  • Fix the blocker.
  • Refresh registry data or choose a registered active repo.
  • Check active issues and PRs before submitting.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@loopover-orb loopover-orb Bot added gittensor gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. labels Jun 30, 2026
@dosubot dosubot Bot added the lgtm label Jun 30, 2026
@JSONbored
JSONbored merged commit 752381d into JSONbored:main Jun 30, 2026
9 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in gittensory - v1 roadmap Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

observability(selfhost): add Sentry cron monitors for scheduled work

2 participants