CI 8551 integration: "integer out of range" for a 2099 timestamp. The SQL in the log showed a second problem: `CAST(epoch AS INTEGER) / 60` compiled to `/ CAST(60 AS NUMERIC)`, i.e. decimal division. Every scrape got its own "bucket", so the request chart and the Traefik page's sparklines never averaged anything. The int4 cast would also overflow in 2038. Both now use date_bin from the epoch, as host_agent/metrics_query.py does. The integration test adds a second scrape 30 s later in the same minute and checks that the bucket averages the totals and weights the 5xx share over both scrapes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>