Report per-request and per-job cost to PostHog for hotspot detection

Every request, queue batch, cron task and Durable Object alarm now counts its D1 statements, replica reads, RepoState/AccountState calls, their time and the rows read and written, and reports one server_request or server_job event. Failing, slow or heavy units are always sent; the rest are sampled at PERF_SAMPLE_RATE with a weight so totals can be estimated. docs/analytics.md has the HogQL to rank routes by latency, rows read and growth.

Assisted-by: Crush
taigrrcommitted parent 6f2865f364055944b7599106546ca357ef09174a2005497Browse files
11 files changed+475−101

Rendering diff…