Analytics Operations
get_analytics
Retrieves analytics data from the server.
operation
(required) - must always beget_analytics
metric
(required) - any value returned bylist_metrics
start_time
(optional) - Unix timestamp in secondsend_time
(optional) - Unix timestamp in secondsget_attributes
(optional) - array of attribute names to retrieveconditions
(optional) - array of conditions to filter results (see search_by_conditions docs for details)
Body
{
"operation": "get_analytics",
"metric": "resource-usage",
"start_time": 1609459200,
"end_time": 1609545600,
"get_attributes": ["id", "metric", "userCPUTime", "systemCPUTime"],
"conditions": [
{
"attribute": "node",
"operator": "equals",
"value": "node1.example.com"
}
]
}
Response 200
[
{
"id": "12345",
"metric": "resource-usage",
"userCPUTime": 100,
"systemCPUTime": 50
},
{
"id": "67890",
"metric": "resource-usage",
"userCPUTime": 150,
"systemCPUTime": 75
}
]
list_metrics
Returns a list of available metrics that can be queried.
operation
(required) - must always belist_metrics
metric_types
(optional) - array of metric types to filter results; one or both ofcustom
andbuiltin
; default isbuiltin
Body
{
"operation": "list_metrics",
"metric_types": ["custom", "builtin"]
}
Response 200
["resource-usage", "table-size", "database-size", "main-thread-utilization", "utilization", "storage-volume"]
describe_metric
Provides detailed information about a specific metric, including its structure and available parameters.
operation
(required) - must always bedescribe_metric
metric
(required) - name of the metric to describe
Body
{
"operation": "describe_metric",
"metric": "resource-usage"
}
Response 200
{
"attributes": [
{
"name": "id",
"type": "number"
},
{
"name": "metric",
"type": "string"
},
{
"name": "userCPUTime",
"type": "number"
},
{
"name": "systemCPUTime",
"type": "number"
},
{
"name": "node",
"type": "string"
}
]
}