Retrieve aggregated metric data for multiple counters
POST/query/metric/aggregations
This endpoint retrieves aggregated historical data for multiple specified metrics over a given timeline. The data is aggregated using methods such as avg
(average), sum
, min
, max
, or count
, based on the user's request. Users can specify multiple data points (e.g., system.cpu.percent
, system.memory.used.percent
) along with the entity type (e.g., monitor
) and a list of specific entities. Additionally, the timeline for the data can be customized, allowing users to fetch both current and historical data. Unlike the histogram API, this endpoint returns aggregated values rather than time series data, providing a summary view of the metrics based on the selected parameters.
Request
- application/json
Body
required
- Array [
- ]
- Array [
- Array [
- ]
- ]
- Array [
- ]
queries object[]required
A list of queries to retrieve data for multiple metrics. Each query can specify the aggregator, data point, and entity type. To query multiple metrics, add additional query objects, each containing these parameters.
The method of aggregation for the data points, such as 'avg', 'sum', 'min', 'max', and 'count'
The specific metric or data point to query, for example, 'system.cpu.percent'.
The type of entity for which data is being retrieved, for example, 'monitor'.
The specific entity IDs to query the data for. The ID could be a Monitor ID, Group ID, or a Tag value based on the 'entity.type' you have selected
data.filter object
Specifies the pre-filters applied to the data before aggregation. This attribute allows users to define conditions to include or exclude data based on certain criteria before it is processed. Users can group multiple conditions using logical operators and control the filtering logic.
groups object[]
Defines groups of conditions for the pre-filter. Each group consists of multiple conditions that can be combined with a logical operator. You can add a maximum of 3 groups at once.
conditions object[]
List of individual conditions within the group. Each condition specifies a field, an operator, and a value. You can add a maximum of 3 conditions at once.
The field to apply the condition on, such as a metric.
The comparison operator used for filtering. For string values, the possible values are 'in', 'start with', 'end with', '=', and 'contain'. For integer values, the possible values are '=', '>', '>=', '<', '<='
The value to compare the operand against.
Defines whether this group is an inclusion or exclusion filter. The possible values are 'include' and 'exclude'.
Logical operator to combine conditions within the group. The possible values are 'and' and 'or'.
Defines whether the overall pre-filter is an inclusion or exclusion filter. The possible values are 'include' and 'exclude'.
Logical operator to combine all groups in the pre-filter. The possible values are 'and' and 'or'.
result.filter object
Specifies the post-filters applied to the aggregated results. This attribute allows users to refine the output by including or excluding results based on defined conditions after the aggregation process is complete.
conditions object[]
List of conditions to filter the aggregated results. Each condition specifies a field, an operator, and a value. You can add a maximum of 3 conditions at once.
The field to apply the condition on, such as an aggregated metric.
The comparison operator used for filtering. For string values, the possible values are 'in', 'start with', 'end with', '=', and 'contain'. For integer values, the possible values are '=', '>', '>=', '<', '<='
The value to compare the operand against.
Defines whether the post-filter is an inclusion or exclusion filter. The possible values are 'include' and 'exclude'.
Logical operator to combine all conditions in the post-filter. The possible values are 'and' and 'or'.
timeline objectrequired
Defines the time range for the data being retrieved. This includes the start and end dates and times.
The start date for the data retrieval.
The start time for the data retrieval.
The end date for the data retrieval.
The end time for the data retrieval.
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_Aggregation_Category
- Performance_Scalar_Metric_Aggregation_Category
- Array [
- ]
- Array [
- ]
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
- Array [
- ]
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"
}
]
}