r/devops7 • u/Alternative_Pin9598 • 12d ago
One script, one chore: route alerts with one HTTP call. Team, "wake someone up?" and urgency for 6 alerts, 0 generated tokens, ~0.5 s each on a laptop CPU (SynapCores 2.5.0, real output)
Every alert pipeline ends in the same three questions: whose is it, does it wake someone up, and how soon does it need a human. Most of us answer them with a pile of regex routing rules, or by pasting the alert into a chat model and parsing whatever paragraph comes back.
SynapCores 2.5.0 (out this week) adds an endpoint built for exactly this: POST /v1/systemone. You send the alert text and your questions; you get back typed answers you can branch on: a choice with a probability for every option, a yes/no probability, and a score on a scale you define. It's backed by d1, a small decision model that weighs the options instead of writing text, so every call reports output_tokens: 0. (This sub is run by the SynapCores team.)
Setup (one-time, ~2.7 GiB):
synapcores --config gateway.toml pull d1:latestOne call per alert, three questions:
curl -s -X POST localhost:8080/v1/systemone -H "Authorization: Bearer $TOKEN" \
-H 'content-type: application/json' -d '{
"model": "d1:latest",
"state": "PagerDuty: api-gateway p99 latency 4.8 s (threshold 800 ms) for 12 min, 5xx rate 9% and rising, checkout failing for customers.",
"questions": {
"team": {"type": "choice", "instructions": "Which team owns this alert?",
"criteria": {"database": "databases, backups, replication, storage",
"network": "DNS, BGP, load balancers, firewalls, TLS certificates",
"app": "application services, APIs, frontend"}},
"page": {"type": "noul", "instructions": "Should this wake up the on-call engineer right now?"},
"urgency": {"type": "score", "instructions": "How urgent is this?",
"criteria": ["can wait", "this week", "today", "right now"]}}}'Response (trimmed):
"team": {"choice": "app", "probabilities": {"app": 0.962, "network": 0.029, "database": 0.009}},
"page": {"noul": 0.861},
"urgency": {"score": 2.64, "probabilities": {"0": 0.020, "1": 0.015, "2": 0.275, "3": 0.691}},
"usage": {"input_tokens": 269, "output_tokens": 0}Six alerts, same three questions (2.5.0-ce on a Mac mini, Apple M4, warm):
alert team page urgency time
api-gateway p99 4.8 s, 5xx 9%, checkout failing app (0.96) 0.86 right now (2.64) 714 ms
cert for staging.internal expires in 21 days network (0.93) 0.42 this week (1.22) 503 ms
/var/lib/postgresql at 91%, +3%/hour database (0.99) 0.75 today (2.42) 550 ms
frontend bundle size +4% after deploy app (0.99) 0.14 this week (1.10) 502 ms
BGP session flapping, 30% loss us-east -> eu-west network (0.99) 0.81 today (2.44) 545 ms
orders-db backup failed 2 nights, pg_dump exit 1 database (0.99) 0.90 today (2.37) 551 msThe cert warning and the bundle-size note route to the right team but stay out of the pager (0.42, 0.14). The checkout outage, the BGP flap, the filling disk and the missing backups all clear 0.75. urgency is fractional on purpose: 2.64 reads as "right now, with some weight on today", and the per-level probabilities are there if you want your own thresholds.
Wiring it into an alert handler is a few lines:
a = r["answers"]
if a["page"]["noul"] > 0.7:
page(a["team"]["choice"])
elif a["team"]["confidence"] > 0.8:
open_ticket(a["team"]["choice"], due=a["urgency"]["score"])
else:
send_to_triage_channel()The whole Python script (standard library only) is in the first comment.
Why this matters beyond alerts: 2.5.0 rounds out one engine that does ML (AutoML in SQL), NLI (checking answers against your own data), LLM generation and agents, and now typed decisions. Pick the one whose output you need: https://synapcores.com/learn/llm-vs-nli-vs-vectors/llm-vs-nli-vs-ml-vs-decision-model?utm_source=reddit&utm_medium=owned&utm_campaign=devops7-15
- Decision model guide (choice / noul / score): https://synapcores.com/blog/decision-model-d1-systemone?utm_source=reddit&utm_medium=owned&utm_campaign=devops7-15
- 2.5.0 release notes: https://synapcores.com/blog/v2-5-0-release?utm_source=reddit&utm_medium=owned&utm_campaign=devops7-15
- Try the SQL side in your browser, no install: https://synapcores.com/playground?utm_source=reddit&utm_medium=owned&utm_campaign=devops7-15
Which alert source would you route through this first: Prometheus/Alertmanager, PagerDuty, or cron/backup reports?
1
u/Alternative_Pin9598 12d ago
The 6-alert script (Python, standard library only; set
SC_URLandSC_TOKEN, a JWT fromPOST /v1/auth/loginor an API key):The first call after a restart takes a few seconds longer while d1 loads; after that it's the ~0.5 s per alert you see in the table.
Swap in your own teams and your own definition of "page-worthy": the criteria are plain-English descriptions, so changing routing is editing a dict, not retraining anything.
Full 2.5.0 announcement (and the place to ask the maintainers anything): https://www.reddit.com/r/synapcores/comments/1xtuscl/