Skip to main content
Version: 4.6

Analytics Operations

get_analytics

Retrieves analytics data from the server.

  • operation (required) - must always be get_analytics
  • metric (required) - any value returned by list_metrics
  • start_time (optional) - Unix timestamp in seconds
  • end_time (optional) - Unix timestamp in seconds
  • get_attributes (optional) - array of attribute names to retrieve
  • conditions (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 be list_metrics
  • metric_types (optional) - array of metric types to filter results; one or both of custom and builtin; default is builtin

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 be describe_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"
}
]
}