Skip to main content
The agent emits a heartbeat to the cloud on a fixed interval (typically every 30 seconds). The payload is the agent’s view of its own runtime state. The cloud uses the payload to compute 24-hour uptime, restart counts, and lag alerts.

Endpoint

Body

Field reference

Response

The cloud acknowledges a heartbeat with a small JSON body:
definitions_version is an opaque string that changes whenever the metric definitions assigned to this agent change: a metric is created, edited, deleted, or moved to or from this agent. The GET /api/agent/metrics-definitions response carries the same value in its X-Observer-Definitions-Version header. When a heartbeat returns a version that differs from the one of the agent’s last fetch, the agent fetches its definitions again right away, so a change in the console reaches the agent within about one heartbeat interval (30 seconds). Agent 1.6.0 and later act on it. When two processes share one agent key, the response to the process that lost ownership is { "ok": true, "fenced": true } with no other fields. See Duplicate key detection. The definitions_version field is optional. An agent that does not recognise it, or a cloud that does not send it, falls back to the periodic fetch: every 30 seconds for the first 10 minutes after start while the agent has no definitions, then every 5 minutes. Agents older than 1.6.0 fetch every 5 minutes.

Lag and uptime alerts

The queue and uptime numbers in the heartbeat drive two alerts:
  • agent.lag_high: opens when queue_depth is above 1000 or queue_oldest_age_seconds is above 300.
  • agent.uptime_degraded: opens when uptime over the last 24 hours falls below 95%.
These alerts surface on the agent detail page and as alert events to any destination on the Alerts page that subscribes to them. A separate agent.offline event fires when the cloud stops receiving heartbeats from the agent.

Duplicate key detection

The agent sends its start time in an Agent-Started-At header on every request. When two processes share one agent key, the cloud treats the most recently started process as the owner:
  • Heartbeats from the older process are acknowledged but ignored. They do not count toward uptime and do not update the dashboard.
  • Pushes from the older process are rejected with HTTP 409. The agent drops the rejected samples instead of retrying and logs a warning at most once every five minutes.
  • The dashboard shows a duplicate key warning on the agent, and an agent.duplicate_key alert event fires (state open) to any destination on the Alerts page that subscribes to it. Once the older process goes quiet for ten minutes, the warning clears and a cleared event follows.
Restart detection is monotonic: only a strictly newer agent_started_at records a restart. There is one escape hatch: when the process holding the newer start time stops heartbeating for ten minutes, a fenced process may take over as the owner. This recovers a single agent whose clock moved backwards across a restart without operator action. To resolve a duplicate key situation, stop one of the two processes, or rotate the key and give each deployment its own agent.

Versioning

Field additions to the payload are additive. Older agents that omit newer fields stay compatible; older cloud versions ignore fields they do not recognise.