Files
multica/server/migrations/115_agent_runtime_last_seen_at_index.up.sql
Multica Eve 945d684afd MUL-2965 fix(metrics): harden business sampler quality (#3738)
* fix(metrics): harden business sampler quality (MUL-2965)

Co-authored-by: multica-agent <github@multica.ai>

* fix(metrics): alert on sampler acquire failures

Co-authored-by: multica-agent <github@multica.ai>

---------

Co-authored-by: Eve <eve@multica-ai.local>
Co-authored-by: multica-agent <github@multica.ai>
2026-06-04 11:21:51 +08:00

9 lines
445 B
SQL

-- Covers sampler reads over runtime heartbeats:
-- * runtime_online: last_seen_at > now() - online window
-- * runtime_heartbeat_age: last_seen_at > now() - 15 minutes ORDER BY last_seen_at DESC
--
-- agent_runtime heartbeat writes are frequent, so this must stay in its own
-- single-statement migration and must use CONCURRENTLY.
CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_agent_runtime_last_seen_at
ON agent_runtime (last_seen_at);