monoscope/shared
Anthony Alaribe 8d9a9bbde2 fix(kql): a unitless bin() width is seconds, not the five-minute fallback
Follow-up to 6a23360e0, which turned an unparseable bin() width into a parse
error. That surfaced two unit tests asserting

  bin(timestamp, 60)  ->  time_bucket('5 minutes', timestamp)

— the silent fallback, written down as the expected result. My push left CI red
because I ran doctests and an end-to-end check but not `make test-unit`.

A bare number is SECONDS. The shipped README is the evidence:

  method == "GET" | summarize count(*) by bin(timestamp, 86400)

which plainly means a daily bucket and until now drew five-minute ones — our own
documented example was broken.

Blast radius is small and all of it corrective. `bin(timestamp, 300)` — the form
in the bundled query snippets — is unchanged, because 300 seconds IS five
minutes; that coincidence is why this hid so long. Only `60` (now 1 minute) and
`86400` (now 1 day) move, both to what their author obviously meant.

Unit tests updated to the correct widths with a note that they previously
encoded the bug. 275 unit examples and 1324 doctests pass.
History 2026-08-31 18:40:12 +02:00
..
src fix(kql): a unitless bin() width is seconds, not the five-minute fallback 2026-08-31 18:40:12 +02:00
monoscope-shared.cabal feat(live-tail): stream matching logs from the ingest path over SSE 2026-08-12 12:19:08 +02:00