Skip to content

Get Engine Heartbeat

GET
/api/system/heartbeat

Get engine heartbeat data for Operator Console.

Returns engine heartbeat information including uptime, PID, build ID, and tick counter. This endpoint exposes the same data available in-process via instrument.get_heartbeat().

Returns:

  • tick (int): Monotonic tick counter (incremented by beat())
  • pid (int): Engine process ID
  • build (str): Build ID (git commit hash or “dev-unknown”)
  • start_time (float): Engine start timestamp
  • uptime (float): Engine uptime in seconds
  • last_beat (float): Timestamp of last heartbeat beat() call

Example Response:

{
  "tick": 1234,
  "pid": 12345,
  "build": "2aae3712",
  "startTime": 1704900000.0,
  "uptime": 1234.5,
  "lastBeat": 1704901234.5
}

Raises:

  • HTTPException(503): If instrumentation layer is not available
  • HTTPException(500): If heartbeat retrieval fails

Use Cases:

  • Operator Console standalone mode
  • External monitoring tools
  • Health check systems

Successful Response

InstrumentHeartbeatResponse

Response model for engine heartbeat data.

Provides engine heartbeat information including uptime, PID, build ID, and tick counter. Used by instrument_routes for exposing instrumentation layer heartbeat data to Operator Console.

Fields:

  • tick: Monotonic tick counter (required, integer)
  • pid: Engine process ID (required, integer)
  • build: Build ID (required, string)
  • start_time: Engine start timestamp (required, float)
  • uptime: Engine uptime in seconds (required, float)
  • last_beat: Timestamp of last heartbeat beat() call (required, float)

Usage: GET /api/system/heartbeat returns this response model.

JSON Example:

{
  "tick": 1234,
  "pid": 12345,
  "build": "2aae3712",
  "startTime": 1704900000.0,
  "uptime": 1234.5,
  "lastBeat": 1704901234.5
}
object
tick
required
Tick

Monotonic tick counter (incremented by beat())

integer
pid
required
Pid

Engine process ID

integer
build
required
Build

Build ID (git commit hash or ‘dev-unknown’)

string
startTime
required
Starttime

Engine start timestamp

number
uptime
required
Uptime

Engine uptime in seconds

number
lastBeat
required
Lastbeat

Timestamp of last heartbeat beat() call

number