Entity: metrics
Description
Retrieves a list of metrics collected by the entity.
Request
| Method | Path |
|---|---|
GET | /api/v1/entities/{entity}/metrics |
Path Parameters
| Name | Type | Description |
|---|---|---|
entity | string | Entity name. |
Query Parameters
| Name | Type | Description |
|---|---|---|
expression | string | Include metrics that match a filter expression consisting of fields and operators. Example: name LIKE 'cpu*'.Supported wildcards: * and ?. |
minInsertDate | string | Include metrics with last insert date equal or greater than specified time. minInsertDate can be specified in ISO format or using calendar keywords. |
maxInsertDate | string | Include metrics with last insert date less than specified time.maxInsertDate can be specified in ISO format or using calendar keywords. |
useEntityInsertTime | boolean | Controls how lastInsertDate field in the response is calculated. If true, the field contains the maximum insert time of series collected for the given metric by the specified entity.If false, the field contains the maximum insert time of series collected for the given metric by all entities.Default: true. |
limit | integer | Maximum number of metrics to retrieve, ordered by name. |
tags | string | Comma-separated list of metric tags to be included in the response. For example, tags=table,unitSpecify tags=* to include all metric tags. |
addInsertTime | boolean | Controls whether lastInsertDate field is included in the response.The default value is inherited from the default.addInsertTime setting on the Settings > Server Properties page which is set to true by default. |
Expression
The expression can include any field specified in Metrics List method, such as name, label, and minValue, except the filter field and lastInsertDate which can be filtered using minInsertDate and maxInsertDate parameters for performance reasons.
String literals must be enclosed in single or double quotes.
Examples:
label IN ('Employed full time', 'OECD')
tags.fs='ext4'
name LIKE 'cpu*' AND dataType!='FLOAT'
Response
Fields
Refer to Fields specified in Metrics List method.
Example 1
Request
URI
GET /api/v1/entities/nurswgvml007/metrics?limit=2
Payload
None.
curl
curl https://atsd_hostname:8443/api/v1/entities/nurswgvml007/metrics?limit=2 \
-k --user {username}:{password}
Response
[
{
"name": "cpu_busy",
"enabled": true,
"dataType": "FLOAT",
"label": "CPU Busy %",
"persistent": true,
"retentionDays": 0,
"seriesRetentionDays": 0,
"minValue": 0,
"maxValue": 100,
"invalidAction": "TRANSFORM",
"lastInsertDate": "2017-12-18T12:17:04.000Z",
"versioned": false,
"interpolate": "LINEAR",
"timeZone": "US/Eastern"
},
{
"name": "cpu_idle",
"enabled": true,
"dataType": "FLOAT",
"persistent": true,
"retentionDays": 0,
"seriesRetentionDays": 0,
"invalidAction": "NONE",
"lastInsertDate": "2017-12-18T12:17:04.000Z",
"versioned": false,
"interpolate": "LINEAR"
}
]
Example 2
Request
URI
GET /api/v1/entities/nurswgvml007/metrics?useEntityInsertTime=false&tags=*&limit=2
Payload
None.
curl
curl "https://atsd_hostname:8443/api/v1/entities/nurswgvml007/metrics?useEntityInsertTime=false&tags=*&limit=2" \
--insecure --user {username}:{password}
Response
[
{
"name": "disk_used_percent",
"enabled": true,
"dataType": "DECIMAL",
"label": "Disk Used, %",
"persistent": true,
"tags": {
"table": "Disk (script)",
"unit": "Percent (%)"
},
"retentionDays": 0,
"seriesRetentionDays": 60,
"minValue": 0,
"maxValue": 100,
"invalidAction": "TRANSFORM",
"lastInsertDate": "2018-05-23T16:58:47.000Z",
"filter": "!likeAny(tags.mount_point, collection('ignore-collector-mount-points'))",
"versioned": false,
"interpolate": "LINEAR"
}
]