Skip to main content

Healthcheck Widget

Widget Type: rc-healthcheck

Healthcheck Widget

Configuration

id A unique id

name Human readable name

source Telemetry or service source path

sourceType telemetry or service

expression A string containing a javascript function where args is the source output and returns a boolean value.

timeoutMs Optional timeout in milliseconds. If the check takes longer than this time to resolve, it will be marked as unknown. Maximum value is 60000 (1 minute).

Example

{
"type": "healthcheck",
"config": {
"checks": [
{
"id": "heartbeat",
"name": "Heartbeat",
"source": "/rocos/agent/telemetry/heartbeat",
"sourceType": "telemetry",
"expression": "(args) => !!args?.payload?.tim"
},
{
"id": "battery",
"name": "Battery above 30%",
"source": "/spot/robot_state/battery_states",
"sourceType": "telemetry",
"expression": "(args) => args.payload?.[0]?.charge_percentage?.value > 30"
},
{
"id": "lease",
"name": "Lease held",
"source": "/spot/lease/leaseHeld",
"sourceType": "telemetry",
"expression": "(args) => args.payload === true"
},
{
"id": "localised",
"name": "Localised",
"source": "/spot/graphnav/localizationStatus",
"sourceType": "telemetry",
"expression": "(args) => {\n return args.payload?.localization && Object.keys(args.payload.localization).length > 0; }"
},
{
"id": "faults",
"name": "Critical faults",
"source": "/spot/robot_state/faults/critical_faults",
"sourceType": "telemetry",
"expression": "(args) => {\n const faults = args.payload?.faults;\n if (!faults) return true;\n if (Object.keys(faults).length > 0 || faults.length > 0) return false;\n return true;\n }"
},
{
"id": "estops",
"name": "EStops",
"source": "/spot/robot_state/estop_states",
"sourceType": "telemetry",
"expression": "(args) => args.payload?.every((estop) => estop.state === 2)"
},
{
"id": "spotCamBitrate",
"name": "SpotCAM Bitrate",
"source": "/spot/spotcam/stream_quality/getStreamParams",
"sourceType": "service",
"expression": "(args) => args.params?.targetbitrate?.value <= 2097152",
"timeoutMs": 5000
}
]
}
}