Files
daniel 8a09d13800 feat: add Sentry error tracking to workers, dashboard, and CLI
Adds free-tier Sentry error reporting to close the biggest observability
gap: automated cron/worker failures were previously invisible (aitmpl-crons
had no error handling at all). Uses a dependency-free fetch()-based Sentry
envelope client (cloudflare-workers/*/sentry.js, dashboard error-tracking.ts,
cli-tool error-reporting.js) instead of the official SDKs, to keep the
zero-dependency worker style and avoid Cloudflare Pages SSR friction.

- Cloudflare Workers: report failures + Cron Monitor check-ins in crons,
  pulse, and docs-monitor (complementing, not replacing, existing Telegram
  alerts). Also drops the pulse Vercel collector (VERCEL_API/collectVercel),
  since the dashboard no longer deploys to Vercel.
- Dashboard: captureApiError() wired into claude-code-check, health-check,
  and the three track-* endpoints.
- CLI: opt-in only crash reporting (CCT_ERROR_REPORTING=true), always
  deferring to the existing CCT_NO_TRACKING/CCT_NO_ANALYTICS/CI opt-outs.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-04 16:38:20 -04:00

33 lines
1.1 KiB
TOML

# Cloudflare Worker Configuration
# Pulse — Weekly KPI Report
name = "pulse-weekly-report"
main = "index.js"
compatibility_date = "2024-01-01"
# Cron Trigger - Every Sunday at 14:00 UTC (11:00 AM Chile)
[triggers]
crons = ["0 14 * * SUN"]
# Secrets (set via: wrangler secret put <KEY>)
# Required:
# - TELEGRAM_BOT_TOKEN: Telegram bot token (same as docs-monitor)
# - TELEGRAM_CHAT_ID: Telegram chat ID (same as docs-monitor)
# - GITHUB_TOKEN: GitHub PAT (public_repo scope)
# - SUPABASE_URL: Supabase project URL
# - SUPABASE_SERVICE_ROLE_KEY: Supabase service role key
# - DISCORD_BOT_TOKEN: Discord bot token
# - DISCORD_GUILD_ID: Discord server ID
# - VERCEL_TOKEN: Vercel personal access token
# - VERCEL_PROJECT_ID: Vercel project ID
# - TRIGGER_SECRET: Secret for manual /trigger endpoint
#
# Optional (add later):
# - GA_PROPERTY_ID: GA4 property ID
# - GA_SERVICE_ACCOUNT_JSON: Base64-encoded service account JSON
#
# Optional (error tracking):
# - SENTRY_DSN: DSN from the "aitmpl-workers" Sentry project. Also configure a
# Cron Monitor in Sentry with slug "pulse-weekly-report" to get alerted if
# the weekly report stops running entirely.