Cost observability

Cost observability

The Cost Observability Dashboard is the cross-tenant superadmin surface for tracking AI + integration spend. Per-tenant operators see their own spend in AI Cockpit → Cost dashboard; this dashboard is for superadmins who see all tenants.

Open at https://costs.flatsbratislava.com (separate subdomain, superadmin login required).

What's on the dashboard

Daily strip across all tenants

A 14-day bar chart with each day broken out by tenant. Hover a bar to see per-tenant totals; click to drill into that day.

Per-tenant per-agent table

For the selected day:

Column What
Tenant Tenant slug + display name
Agent accounting / messaging / operations / knowledge / property / general / pulse-copilot / translation / message-analysis
Turns How many runs the agent did that day
Avg $/turn Mean cost per turn
Total $ Sum for the day
Cache hit % How often prompt caching reduced cost

Integration cost breakouts

Alongside AI spend:

  • WhatsApp template costs — paid templates sent (24h window closed), per tenant per day.
  • Beds24 credits used — what fraction of the per-minute budget the tenant burned.
  • Hospitable API calls — count + rate-limit headroom.

Daily cron + filters

A nightly cron rolls up the per-LLM-call rows from llm_usage and the per-WA-send rows from wa_send_logs into the dashboard's pre-aggregated tables. Filters (date range, tenant, agent) work over the rolled-up data so the dashboard stays snappy even as data piles up.

Alerts (if configured)

Superadmins can configure alerts:

  • "Page me when any tenant's daily AI spend > €X"
  • "Page me when any agent's avg $/turn > €Y"
  • "Page me when WA template volume on a tenant > N/day"

Alerts fire as in-app + WhatsApp to the superadmin's number.

Export

CSV export of the current view (filters applied) for finance review.

What this dashboard does NOT include

  • Per-day infra cost (Fly machine-hours, S3 egress) — those are on the Fly invoice + the infra status page.
  • Per-tenant operator labor — out of scope for cost dashboard.

Implements: gh#523 (Cost Observability Dashboard: superadmin spend view, daily cron + filters). Related: AI Cockpit → Cost dashboard (per-tenant operator view).

Source: the FlatsBratislava operator manual.