Retrieve historical time-series data for a single metric
POSThttps://ServerIP:PortNumber/api/v1/query/metric/histogram
This endpoint retrieves time-series data for a single specified metric over a given timeline. The data is displayed as a series of data points, each representing a specific moment in time. Users can specify a metric (e.g., system.cpu.percent
), the entity type (e.g., monitor
), and a list of specific entities. The data can be aggregated using methods such as avg
(average) or others based on the user's request. Additionally, the timeline and granularity can be customized, allowing for detailed insights into both current and historical performance metrics.
Request
- application/json
Body
required
queries object[]required
data.filter object
result.filter object
timeline objectrequired
Defines the granularity (sampling interval) for the data. The granularity field must follow the standard time format, where time intervals are represented as '1 s' for 1 second, '1 m' for 1 minute, '1 h' for 1 hour, '1 d' for 1 day.
Specifies the type of data to be retrieved, such as 'metric'. The possible type of data that can be retrieved are 'metric' and 'availability'.
An array of strings specifying how the results should be grouped, The possible values are 'monitor', 'tag', 'group', and 'instance'.
Responses
- 200
- 400
- 403
- 500
Successfully retrieved Historical data with respect to data point with specific aggregator and specific entity type.
- application/json
- Schema
- Example (from schema)
Schema
- Performance_Instance_Metric_Histogram_Category
- Performance_Scalar_Metric_Histogram_Category
result object[]
result object[]
{}
The request was invalid. Possible reasons could include missing required parameters or incorrect parameter values.
- application/json
- Schema
- Example (from schema)
Schema
{
"response-code": 400,
"status": "fail",
"message": "Bad request",
"error.code": "MD031"
}
The client is not authorized to access this resource. Ensure that the correct permissions are granted.
- application/json
- Schema
- Example (from schema)
Schema
{
"response-code": 403,
"message": "Unauthorized access: Client is not allowed to access API",
"error.code": "MD022"
}
An unexpected error occurred on the server. This might be due to a temporary issue or a problem with the request processing.
- application/json
- Schema
- Example (from schema)
Schema
result object[]
{
"result": [
{
"response-code": 500,
"status": "fail",
"message": "Internal server exception, Possible reason: Cannot invoke \"String.length()\" because \"content\" is null",
"error.code": "MD031",
"error": "io.vertx.core.json.jackson.DatabindCodec.createParser(DatabindCodec.java:116)\n\tat io.vertx.core.json.jackson.DatabindCodec.fromString(DatabindCodec.java:90)\n\tat io.vertx.core.json.Json.decodeValue(Json.java:83)\n\tat io.vertx.core.json.Json.decodeValue(Json.java:95)\n\tat"
}
]
}
Authorization: cookie
name: cookietype: apiKeyin: cookie
- curl
- python
- go
- nodejs
- ruby
- csharp
- php
- java
- powershell
- CURL
curl -L 'https://ServerIP:PortNumber/api/v1/query/metric/histogram' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"queries": [
{
"aggregator": "avg",
"data.point": "system.cpu.percent",
"entity.type": "monitor",
"entities": [
83948934
]
}
],
"data.filter": {
"data.filter": {
"groups": [
{
"conditions": [
{
"operand": "network.service.instance.name",
"operator": "contain",
"value": "SSH"
},
{
"operand": "network.service.instance.name",
"operator": "contain",
"value": "HTTPS"
},
{
"operand": "network.service.instance.name",
"operator": "contain",
"value": "Mindarray"
}
],
"filter": "include",
"operator": "or"
},
{
"conditions": [
{
"operand": "network.service.instance.name",
"operator": "=",
"value": "8081 (Apache HTTP)"
},
{
"operand": "network.service.ip.address",
"operator": "=",
"value": "127.0.0.1"
},
{
"operand": "network.service.port",
"operator": "=",
"value": 80
}
],
"filter": "include",
"operator": "or"
},
{
"conditions": [
{
"operand": "network.service.ip.address",
"operator": "=",
"value": "172.16.15.199"
},
{
"operand": "network.service.ip.address",
"operator": "=",
"value": "172.16.15.134"
},
{
"operand": "network.service.ip.address",
"operator": "=",
"value": "172.16.15.123"
}
],
"filter": "exclude",
"operator": "or"
}
],
"filter": "include",
"operator": "or"
}
},
"result.filter": {
"conditions": [
{
"operand": "network.service.latency.ms.avg",
"operator": "=",
"value": 10
},
{
"operand": "network.service.latency.ms.avg",
"operator": "=",
"value": 8
},
{
"operand": "network.service.latency.ms.avg",
"operator": "=",
"value": 5
}
],
"filter": "exclude",
"operator": "and"
},
"timeline": {
"from.date": "2024/10/11",
"from.time": "00:00:00",
"to.date": "2024/10/11",
"to.time": "17:00:00"
},
"granularity": "5 m",
"type": "metric",
"result.by": [
"monitor"
]
}'