feat: revamp analytics dashboards and harden database migrations

Add dashboard and overview analytics, health monitoring, provider expense tracking, and announcement updates across the gateway and frontend.

Keep schema migrations free of historical backfills while preserving automatic backfill execution. Bound migration deadlines, run schema preparation before Compose replacement, and anonymize deleted dashboard users.

Include the current documentation cleanup and regression coverage.
This commit is contained in:
elky
2026-10-01 11:48:17 +08:00
parent 60b89cc840
commit 066ea87d72
327 changed files with 31728 additions and 20645 deletions
@@ -669,8 +669,24 @@ pub(super) async fn run_pending_cleanup_once(app: &AppState) -> Result<(), DataL
pub(super) async fn run_stats_hourly_aggregation_once(
data: &GatewayDataState,
) -> Result<bool, DataLayerError> {
let Some(summary) = perform_stats_hourly_aggregation_once(data).await? else {
return Ok(false);
let legacy = perform_stats_hourly_aggregation_once(data).await;
let overview_progress = match super::stats_hourly::perform_overview_rebuild_once(data).await {
Ok(progress) => progress,
Err(error) => {
warn!(event_name = "overview_rebuild_failed", error = ?error,
"overview rebuild deferred; legacy statistics remain available");
0
}
};
if overview_progress > 0 {
info!(
event_name = "overview_rebuild_progress",
progress = overview_progress,
"overview dirty projections rebuilt"
);
}
let Some(summary) = legacy? else {
return Ok(overview_progress > 0);
};
info!(