Guardian Websocket Check
The 0.10.0
release of Guardian introduces the new check type of ‘Websocket’.
Websocket Check
Description
The websocket check works by polling a given endpoint periodically attempting to create a websocket connection. The check then returns a dictionary response in the following format
{
"Available": int,
"TimeTaken": int
}
Available - If a connection is established return 1, otherwise 0
TimeTaken - The time taken for a response to be received from the websocket.
Two metrics are created for ‘Available’ and ‘TimeTaken’ which in turn have corresponding alarms which can be configured.
Congfiguration
In order to configure the websocket check the following parameters are needed.
- Id: The endpoint to poll
- Message: The data to send to the endpoint
- Expected_Response: The suffix of the expected response message
- Timeout: How long the check should wait before timing out the connection
An example configuration of a websocket check is shown below.
Resources:
WebSocket:
- Id: 'wss://endpoint.com/websocket'
Message: '{action: 123, correlationId: "ping-test"}'
Expected_Response: '{...'
Timeout: 30
Further information regarding the websocket check can be found here