Disclosure: I'm the developer of ScooterLog, and this post is published from my account. It was drafted and published by an AI agent working on my behalf. ScooterLog is an independent app, not affiliated with, endorsed by or sponsored by Ola Electric.
ScooterLog is a small web app that signs a user in to their scooter's own cloud account and logs their battery readings. Its two riskiest steps, sign-in and polling, depend on someone else's API that can change without notice. I wanted failures to reach whoever fixes them without a user having to complain first, and without a daily wall of noise. This is how the digest decides what is worth filing.
Step 1: a signature that carries no user data
Every failure is stored as one row keyed by a signature: the step that failed, the HTTP status, and the upstream's own reason words. Free text, digits and anything typed by the user are dropped before it is a key:
def test_signature_drops_free_text_and_digits():
assert store.defect_sig('verify', 'otp HTTP 401 status=FAILURE code=NOT_FOUND reason=INVALID_PARAMETERS text=x') \
== 'verify | 401 | code=NOT_FOUND | reason=INVALID_PARAMETERS'
assert '9811' not in store.defect_sig('client/login', 'network failed 9811100632')
Two things follow. Identical failures collapse into one row with a hit count and a count of distinct users. And nothing that identifies a person can end up in the digest, because it was never stored in the key.
A row has a state (open, fixed, wontfix). A new hit on a fixed row flips it to regressed, so a fix that did not hold comes back by itself.
Step 2: what is not a defect
The upstream answers a mistyped code with a perfectly valid error. Counting those as defects would bury the real ones, so a list of the upstream's user-error reasons (wrong code, expired code, attempt limit) is counted and shown but never filed on its own. A signature that matches is skipped, and so is anything marked wontfix.
Step 3: new, growing or regressed, and more than one person
The daily run files a signature only if it passes both tests:
-
it is new (first seen in the last 48 hours), or growing (today's hits are more than twice its weekly average:
hits * 7 > 2 * week_hits), or regressed; and - at least two distinct users hit it, unless it belongs to the sign-in class, where one user is already enough.
A single user's one-off JavaScript error never makes the digest. The test from the repo:
rep = {'day': [
dict(base, sig='verify | 401 | reason=INVALID_PARAMETERS', step='verify', hits=5, users=3),
dict(base, sig='verify | 400 | reason=INCORRECT_VERIFICATION_CODE', step='verify', hits=9, users=6),
dict(base, sig='client/home | js: x', step='client/home', hits=1, users=1)], ...}
# the first is filed; the wrong-code one (a typo) and the single-user blip are not
Note the second row has more hits and more users than the first and is still not filed. Volume is not the signal; whether the system is at fault is.
Step 4: a second, faster path for the failures that lock people out
A daily digest is too slow for "nobody can sign in". A 15-minute run looks only at the sign-in class (and the login-rate page), with a lower bar of three users. And so one outage does not file itself 96 times a day, a filed signature is held back for 20 hours in the daily run and 6 hours in the urgent one, unless it has regressed.
Step 5: a model labels it, it does not decide whether to file
Only after the rules above pick candidates does a language model see them, through a central gateway, with a JSON schema that forces one of four classes: ola_changed (the upstream broke or changed something), our_bug, user_error, network, plus a three-line diagnosis (what failed, likely cause, first thing to check). If the gateway is down, the item is filed as unclassified with the gateway error rather than dropped. In the daily digest, user_error and network items are filtered out unless at least ten users hit them. The model never sees a user identity, only the signature, the counts and a sanitised sample.
Step 6: file one incident, mark it filed
The result is one numbered incident per run, written into a repair queue, listing each signature with hits, users, total, state and class, plus the logins-per-hour figure (for example "ok/tries"). The signatures are then marked filed so the next run holds them back. There is also a --dry-run that prints what would be filed and writes nothing.
Takeaways
- Key failures by what failed, not by who or when; drop digits and free text before they become a key.
- Separate the upstream's user-error answers from real defects up front.
- Use "new or growing, and more than one person" as the filing rule, not raw volume.
- Give the failures that block sign-in their own faster, lower-threshold path and a hold-back so one outage is one ticket.
- Let a model label and explain; keep whether to file in plain, testable code.
ScooterLog is an independent app, not affiliated with, endorsed by or sponsored by Ola Electric.
Top comments (0)