Accessing monitoring data

Web API

The Web API provides access to the Monitoring data HTTP GET (see URL list below) and WebSocket streaming. Only the latest state of each process and metric is returned; history must be maintained in the client-monitoring application.

HTTPS can be configured on installation.

URLs

The default port the Web API binds to is 10001. Ensure that the port is specified in the URL when querying the APIs below, e.g. http://localhost:10001/api/list.

Relative URL path Parameters Since Description
/api/list 0.2.5 all supported URLs
/api/getProcesses all processes known to the Monitoring daemon
/api/getProcessStatusSummary all known processes, split by up (online) and down (offline)
/api/getAllProcessDetail information relating to the known processes
/api/getProcessState process Provides all metric information for the specified process
/api/getAllProcessState metric information for all known processes
/api/getStaleSummary all metrics that are stale, by process
/api/getServerStats server 0.7.0 server-level stats gathered by the System Information Generator component
/api/getServerProcessStats server
pid
specified PID stats gathered by the System Information Generator component

Where specific APIs do not exist, all generator data can be accessed by using the /api/getProcessState API call and using the generator name as the process parameter.

Websocket streaming

To receive real-time Monitoring updates via WebSocket, subscribe and unsubscribe as required. Once the subscription is enabled, you will receive update messages containing new data.

The response template when sending messages via WebSocket is:

{ "success": false, "msgType": "error", "data": "Error information" }
{ "success": false, "msgType": "noResponse" }

Enabling subscription

Request:

// Subscribe to all tables
{ "request": "sub" }

// Subscribe to processes and current monitoring state
{ "request": "sub", "tables": [ "MonitoringProcesses", "MonitoringState" ]}

Successful response:

{ "success": true, "msgType": "subResponse", "data": { /* Snapshots */ } }

Disabling subscription

{ "request": "unsub" }

Successful Response:

{ "success": "true", "msgType": "unsubResponse", "data": "Unsubscribe OK" }

Update messages

{ "msgType": "update", "dataType": "TableName", "data": [ /* Data Rows */ ]}

Elasticsearch uploader

The Elasticsearch Uploader sends the Monitoring data to a pre-defined set of indexes. The index is always suffixed with the current date in yyyy.mm.dd format.

The list of indexes:

kx-refinery-monitoring-processes   monitored processes list
kx-refinery-monitoring-metrics     registered metrics for each process
kx-refinery-monitoring-state       state of each metric for building alerts

A snapshot of the current state of all Monitoring data will be published to Elasticsearch when the Uploader subscribes to the Monitoring daemon. All snapshot data will have an additional value snapshot set to true.