Skip to content
This repository was archived by the owner on Nov 9, 2026. It is now read-only.
This repository was archived by the owner on Nov 9, 2026. It is now read-only.

feat: Sentry Crons — check_in ingest + monitor staleness alerts #360

Open

Description

@ajianaz

Summary

Implement Sentry Crons compatibility: accept check_in envelope items from any Sentry SDK and alert when monitors miss their expected schedule.

Why

  • Fleet runs many scheduled jobs (backups, novel factory, indexers). A missed cron is a silent failure that error tracking alone never sees.
  • Sentry SDKs already send monitor check-ins as check_in envelope items (monitor_slug, status: ok|in_progress|error, optional monitor_config with crontab schedule). Zero new SDK work for consumers — same drop-in DSN swap story.

Design (seams)

  • Ingest seam (trapfall-ingest/src/envelope.rs): add check_in to the item-type match; new proto types CheckIn, MonitorConfig.
  • Digest seam (trapfalld/src/digest.rs): persist check-ins, upsert monitor state (slug, last_seen, status, crontab).
  • Staleness evaluation: extend the existing hourly background task pattern (retention.rs) — a monitor whose crontab window has elapsed without an ok check-in flips to missed and flows into the alert pipeline.
  • Alert seam (trapfalld/src/alert.rs): the engine currently consumes Issue. Generalize its input to an enum (e.g. AlertSignal::Issue(..) | MonitorMissed(..)) so ONE webhook pipeline delivers both. Do NOT bolt on a second parallel channel (shallow duplication).

Acceptance criteria

  • check_in items parsed (binary-safe path included); unknown monitor slugs auto-register on first check-in
  • Monitor APIs: GET /api/0/projects/{slug}/monitors, GET /api/0/projects/{slug}/monitors/{id}/checkins
  • missed/error monitor triggers the existing webhook pipeline (cooldown respected)
  • Next free migration number (SQLite + Postgres); retention purge covers check-ins
  • MCP: list_monitors tool
  • Tests: envelope parse, staleness evaluation, alert dispatch; CI green incl. web-build

Non-goals

  • Uptime/HTTP probes (GlitchTip-style synthetic monitoring) — Gatus/Uptime-Kuma territory
  • Crash detection via sessions is already covered by release health

Notes for implementer

  • Branch from fresh origin/develop (post v0.3.0). Sequential-issues rule applies: merge this PR before starting the next issue's branch.
  • No AI attribution in commits/PR (fleet standard).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions