List Metrics
You can narrow down the output by selecting metrics in the metricSelector field.
You can additionally limit the output by using pagination:
Specify the number of results per page in the pageSize query parameter.
Then use the cursor from the nextPageKey field of the response in the nextPageKey query parameter to obtain subsequent pages. All other query parameters must be omitted.
Basic Parameters
Parameter | Description |
---|---|
Query | Metric registry search term. Only show metrics that contain the term in their key, display name, or description. Use the metricSelector parameter instead of this one to select a complete metric hierarchy instead of doing a text-based search. |
Advanced Parameters
Parameter | Description |
---|---|
Fields | Defines the list of metric properties included in the response.metricId is always included in the result. The following additional properties are available:
+ . To exclude default properties, list them with leading minus - .To specify several properties, join them with a comma (for example fields=+aggregationTypes,-description ).If you specify just one property, the response contains the metric key and the specified property. To return metric keys only, specify metricId here. |
Metadata Selector | The metadata scope of the query. Only metrics with specified properties 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.
, ). For example, tags("feature","cloud"),unit("Percent"),dimensionKey("location"),custom("true") . Only results matching all criteria are included in response.For example, to list metrics that have the tags feature AND cloud with a unit of Percent OR MegaByte AND a dimension with a dimension key location, use this metadataSelector: tags("feature"),unit("Percent","MegaByte"),tags("cloud"),dimensionKey("location") . |
Metric Selector | Selects metrics for the query by their keys.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) .You can select a full set of related metrics by using a trailing asterisk (* ) wildcard. For example, builtin:host.* selects all host-based metrics and builtin:* selects all Dynatrace-provided metrics.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.Only aggregation , merge , parents , and splitBy transformations are supported by this endpoint.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~"" To find metrics based on a search term, rather than metricId, use the text query parameter instead of this one. |
Next Page Key | The cursor for the next page of results. You can find it in the nextPageKey field of the previous response.The first page is always returned if you don't specify the nextPageKey query parameter.When the nextPageKey is set to obtain subsequent pages, you must omit all other query parameters. |
Page Size | The amount of metric schemata in a single response payload.The maximal allowed page size is 500.If not set, 100 is used.If a value higher than 500 is used, only 500 results per page are returned. |
Written Since | Filters the resulted set of metrics to those that have data points within the specified timeframe.You can use one of the following formats:
|
Example Output
{
"metrics": [
{
"aggregationTypes": [
"auto",
"value"
],
"created": 1597400123451,
"dduBillable": false,
"defaultAggregation": {
"type": "value"
},
"description": "Percentage of user-space CPU time currently utilized, per host.",
"dimensionDefinitions": [
{
"displayName": "Host",
"index": 0,
"key": "dt.entity.host",
"name": "Host",
"type": "ENTITY"
}
],
"displayName": "CPU user",
"entityType": [
"HOST"
],
"lastWritten": 1597400717783,
"metricId": "builtin:host.cpu.user:splitBy(\"dt.entity.host\"):max:fold",
"metricValueType": {
"type": "unknown"
},
"tags": [],
"transformations": [
"filter",
"fold",
"limit",
"merge",
"names",
"parents",
"timeshift",
"rate",
"sort",
"last",
"splitBy"
],
"unit": "Percent"
},
{
"aggregationTypes": [
"auto",
"value"
],
"created": 1597400123451,
"dduBillable": false,
"defaultAggregation": {
"type": "value"
},
"description": "Percentage of user-space CPU time currently utilized, per host.",
"dimensionDefinitions": [
{
"displayName": "Host",
"index": 0,
"key": "dt.entity.host",
"name": "Host",
"type": "ENTITY"
}
],
"displayName": "CPU user",
"entityType": [
"HOST"
],
"lastWritten": 1597400717783,
"metricId": "builtin:host.cpu.user:splitBy()",
"metricValueType": {
"type": "unknown"
},
"tags": [],
"transformations": [
"filter",
"fold",
"limit",
"merge",
"names",
"parents",
"timeshift",
"rate",
"sort",
"last",
"splitBy"
],
"unit": "Percent"
}
],
"nextPageKey": "ABCDEFABCDEFABCDEF_",
"totalCount": 3
}
Workflow Library Example
List Metrics with Dynatrace and Send Results Via Email
Preview this Workflow on desktop