feat: per-provider availability + slack alerts on offline/recovered#98
Merged
Merged
Conversation
Provider lifecycle When prom returns null for a provider's p50/p90/p99 queries this cycle, spec.ts now tags the augmented entry with availability='unavailable' instead of leaving it as a row of zeros that ranks #1 on lower-is-better benches (the 0slot / cardano UX bug). LedgerTable renders the row at the bottom with a soft amber pill 'Currently unavailable' + 'Awaiting next successful scrape'. Stats helpers (computeFieldStats, rankProviders, benchmark-body, chain-headings-summary, bench-template, citation) all exclude unavailable rows so Best/Median/Spread no longer collapse to 0. Slack alerting New /api/cron/health-check route. For each live bench it asks prom two questions per provider: 'did you receive samples in the last 10 min?' and the same query offset 6 min back. The edge (was-live xor is-live) triggers a slack post via SLACK_WEBHOOK_URL env. No external state - we use prom's own series history as the source of truth. Operator setup (one-time, in Vercel project settings) - SLACK_WEBHOOK_URL : the incoming-webhook url (channel of choice) - CRON_SECRET : random string, used to gate the cron route vercel.json schedules the route every 5 minutes. Vercel injects the Authorization: Bearer $CRON_SECRET header automatically.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Deux changements liés :
1. Per-provider 'Currently unavailable' UI
Les providers sans data ce cycle (0slot, cardano, harness down) étaient rendus avec p50=0 → rang #1 sur les benches lower-is-better. Maintenant : tag
availability='unavailable', ligne triée en bas, affichage 'Currently unavailable' + 'Awaiting next successful scrape', stats helpers les excluent.2. Slack alerts via Vercel Cron
Nouveau
/api/cron/health-checktoutes les 5min. Pour chaque provider, query prom 'samples reçus dans les 10 dernières min ?' vs 'idem mais 6 min en arrière'. Le diff (transition up↔down) post sur Slack. Pas de DB externe, prom est la source de vérité.Setup operator (1 fois):
SLACK_WEBHOOK_URLdans Vercel env (production)CRON_SECRETrandom string (Vercel l'injecte commeAuthorization: Bearerauto)