Home / API Documentation / Operations center / Monitoring indicators / View monitoring data for multiple indicators over time

*View monitoring data for multiple indicators over time

Requests

HTTP request

POST /v2/metrics/{cluster}/query_range

Query range cpaas indicator

Path parameters

Name Type Required Description
cluster string TrueCluster name

Request body

Content-Type application/json

Sample request

Body for metrics query range.

{
   "end": 1640674800,
   "queries": [
     {
       "id": "total",
       "indicator": "platform.alerts.fired.count",
       "name": "total",
       "variables": {
         "range": "600s"
       }
     }
   ],
   "start": 1640671200,
   "step": 600
 }

Parmeters

Name Type Required Description
end integer True Unix timestamp in seconds for end.
Path: end
queries array True Queries to execute.
Path: queries
queries[] object True A query item.
Path: queries[]
queries[].id string True An id to distinguish queries.
Path: queries[].id
queries[].indicator string True indicator name.
Path: queries[].indicator
queries[].variables object True key/value pair for variables
Path: queries[].variables
start integer True Unix timestamp in seconds for start.
Path: start
step integer True Step for metrics points in seconds.
Path: step

Responses

Content-Type application/json

Status code: 200

OK

Sample response

Query result from prometheus.

[
   {
     "id": "total",
     "result": [
       {
         "metric": {
           "alert_kind": "cluster"
         },
         "values": [
           [
             1640671200,
             "0"
           ],
           [
             1640671800,
             "2"
           ],
           [
             1640672400,
             "0"
           ],
           [
             1640673000,
             "0"
           ],
           [
             1640673600,
             "0"
           ],
           [
             1640674200,
             "0"
           ],
           [
             1640674800,
             "0"
           ]
         ]
       },
       {
         "metric": {
           "alert_kind": "workload"
         },
         "values": [
           [
             1640671200,
             "0"
           ],
           [
             1640671800,
             "0"
           ],
           [
             1640672400,
             "0"
           ],
           [
             1640673000,
             "0"
           ],
           [
             1640673600,
             "0"
           ],
           [
             1640674200,
             "0"
           ],
           [
             1640674800,
             "0"
           ]
         ]
       }
     ],
     "resultType": "matrix"
   }
 ]

Parameters

Name Type Description
[] object Query result data from prometheus.
Path: []
[].id string Query id.
Path: [].id
[].result array Value in result from prometheus.
Path: [].result
[].resultType string Metrics type.
Path: [].resultType
[].result[] object Value of query result
Path: [].result[]
result[].metric object Metrics in result from prometheus.
Path: [].result[].metric

Other status codes

More request body examples

Query the CPU usage and CPU utilization of multiple nodes

{
"start":1640935140,
"end":1640938740,
"name":"nearly_1_hour",
"step":60,
"queries":[
{
"id":"cpu_usage_rate",
"indicator":"node.cpu.utilization",
"metricSourceKey":"instance",
"variables":{
"name":".*",
"ip":".*"
}
},
{
"id":"cpu_usage",
"indicator":"node.cpu.usage",
"metricSourceKey":"instance",
"variables":{
"name":".*",
"ip":".*"
}
}
]
}