0.31.1: make dashboard metrics honest

- Container card now compares compose-only counts across hosts: agents
  report compose_running in /agent/system (pre-0.31.1 agents fall back to
  the all-containers number); card retitled, ResourceBar stat labelled
  'Containers (all)'.
- Uptime is sampled every 5 min (background loop + opportunistic on read)
  and charted as daily averages instead of a once-a-day snapshot; no
  sample is written when no compose containers exist (was: fake 100%).
  Legacy daily entries in uptime.jsonl still count; file pruned at startup.
- Funnel stage 'monitored' is now per-stack and real: stacks with an
  enabled local auto-update policy (was: global webhook-exists toggle).
  Frontend label renamed to 'Auto-managed'.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
menzelj
2026-06-12 08:13:16 +00:00
co-authored by Claude Fable 5
parent 1609b8bcc3
commit 11effdc2ca
7 changed files with 127 additions and 41 deletions
+4 -2
View File
@@ -35,7 +35,7 @@ from routers import (
volumes,
ws,
)
from services import schedule_service, template_service, update_service
from services import dashboard_service, schedule_service, template_service, update_service
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger("stackpilot")
@@ -58,13 +58,15 @@ async def lifespan(app: FastAPI):
logger.warning("Legacy template migration failed: %s", exc)
update_task = asyncio.create_task(update_service.background_loop())
schedule_task = asyncio.create_task(schedule_service.scheduler_loop())
uptime_task = asyncio.create_task(dashboard_service.uptime_sampler_loop())
logger.info("StackPilot backend ready on port %s", settings.PORT)
yield
update_task.cancel()
schedule_task.cancel()
uptime_task.cancel()
app = FastAPI(title="StackPilot", version="0.31.0", lifespan=lifespan)
app = FastAPI(title="StackPilot", version="0.31.1", lifespan=lifespan)
app.add_middleware(
CORSMiddleware,