Query Metric
The following limits apply:
- The amount of aggregated data points in the response is limited to 1,000
- The amount of series in the response is limited to 1,000
- The amount of data points per series is limited to 10,080 (minutes of one week)
- The overall amount of data points is limited to 100,000
The dataPointCountRatio specifies the ratio of queried data points divided by the maximum number of data points per metric that are allowed in a single query. The dimensionCountRatio specifies the ratio of queried dimension tuples divided by the maximum number of dimension tuples allowed in a single query.
Basic Parameters
Parameter | Description |
---|---|
Metric Selector | Selects metrics for the query by their keys. You can select up to 10 metrics for one query.You can specify multiple metric keys separated by commas (for example, metrickey1,metrickey2 ). To select multiple metrics belonging to the same parent, list the last part of the required metric keys in parentheses, separated by commas, while keeping the common part untouched. For example, to list the builtin:host.cpu.idle and builtin:host.cpu.user metric, write: builtin:host.cpu.(idle,user) .If the metric key contains any symbols you must quote (" ) the key. The following characters inside of a quoted metric key must be escaped with a tilde (~ ):
"ext:selfmonitoring.jmx.Agents: Type ~"APACHE~"" You can set additional transformation operators, separated by a colon (: ). See Metrics selector transformations in Dynatrace Documentation for additional information on available result transformations and syntax. |
Advanced Parameters
Parameter | Description |
---|---|
Entity Selector | Specifies the entity scope of the query. Only data points delivered by matched entities are included in response.You must set one of these criteria:
EQUALS operator is used unless otherwise specified.
, ). For example, type("HOST"),healthState("HEALTHY") . Only results matching all criteria are included in the response.The maximum string length is 2,000 characters.Use the GET /metrics/{metricId} call to fetch the list of possible entity types for your metric.To set a universal scope matching all entities, omit this parameter. |
From | The start of the requested timeframe.You can use one of the following formats:
now-2h ). |
Management Zone Selector | The management zone scope of the query. Only metrics data relating to the specified management zones are included to the response.You can set one or more of the following criteria. Values are case-sensitive and the EQUALS operator is used. If several values are specified, the OR logic applies.
|
Resolution | The desired resolution of data points.You can use one of the following options:
|
To | The end of the requested timeframe.You can use one of the following formats:
|
Example Output
{
"nextPageKey": "null",
"resolution": "1h",
"result": [
{
"data": [
{
"dimensionMap": {
"dt.entity.disk": "DISK-F1266E1D0AAC2C3F",
"dt.entity.host": "HOST-F1266E1D0AAC2C3C"
},
"dimensions": [
"HOST-F1266E1D0AAC2C3C",
"DISK-F1266E1D0AAC2C3F"
],
"timestamps": [
3151435100000,
3151438700000,
3151442300000
],
"values": [
11.1,
22.2,
33.3
]
},
{
"dimensions": [
"HOST-F1266E1D0AAC2C3C",
"DISK-F1266E1D0AAC2C3D"
],
"timestamps": [
3151435100000,
3151438700000,
3151442300000
],
"values": [
111.1,
222.2,
333.3
]
}
],
"dataPointCountRatio": "0.1211",
"dimensionCountRatio": "0.0322",
"metricId": "builtin:host.disk.avail"
},
{
"data": [],
"metricId": "builtin:host.cpu.idle:filter(eq(\"dt.entityhost\",HOST-123))",
"warnings": [
"The dimension key `dt.entityhost` has been referenced, but the metric has no such key."
]
}
],
"totalCount": 3,
"warnings": [
"The dimension key `dt.entityhost` has been referenced, but the metric has no such key."
]
}
Workflow Library Example
Query Metric with Dynatrace and Send Results Via Email
Preview this Workflow on desktop