Metrics API - GET metric descriptor
Gets the parameters of the specified metric.
The request produces one of the following types of payload, depending on the value of the Accept request header:
application/json
text/csv; header=present
—a CSV table with header rowtext/csv; header=absent
—a CSV table without header row
If no Accept header is provided with the request, an application/json
payload is returned.
GET | ManagedDynatrace for Government | https://{your-domain}/e/{your-environment-id}/api/v2/metrics/{metricKey} |
SaaS | https://{your-environment-id}.live.dynatrace.com/api/v2/metrics/{metricKey} | |
Environment and Cluster ActiveGate (default port 9999) | https://{your-activegate-domain}:9999/e/{your-environment-id}/api/v2/metrics/{metricKey} |
Authentication
To execute this request, you need an access token with metrics.read
scope.
To learn how to obtain and use it, see Tokens and authentication.
Parameters
Parameter | Type | Description | In | Required |
---|---|---|---|---|
metricKey | string | The key of the required metric. You can set additional transformation operators, separated by a colon ( | path | required |
Response
Response codes
Code | Type | Description |
---|---|---|
200 | MetricDescriptor | Success |
404 | - | A metric has not been found. |
406 | - | Not acceptable. The requested media type is not supported. Check the Accept header of your request. |
Response body objects
The MetricDescriptor
object
The descriptor of a metric.
Element | Type | Description |
---|---|---|
aggregationTypes | string[] | The list of allowed aggregations for this metric.
|
billable | boolean | If Metric expressions don't return this field. |
created | integer | The timestamp of metric creation. Built-in metrics and metric expressions have the value of |
dduBillable | boolean | If Metric expressions don't return this field. |
defaultAggregation | MetricDefaultAggregation | The default aggregation of a metric. |
description | string | A short description of the metric. |
dimensionCardinalities | MetricDimensionCardinality[] | The cardinalities of MINT metric dimensions. |
dimensionDefinitions | MetricDimensionDefinition[] | The fine metric division (for example, process group and process ID for some process-related metric). For ingested metrics, dimensions that doesn't have have any data within the last 15 days are omitted. |
displayName | string | The name of the metric in the user interface. |
entityType | string[] | List of admissible primary entity types for this metric. Can be used for the |
impactRelevant | boolean | The metric is ( An impact-relevant metric is highly dependent on other metrics and changes because an underlying root-cause metric has changed. Metric expressions don't return this field. |
lastWritten | integer | The timestamp when the metric was last written. Has the value of |
latency | integer | The latency of the metric, in minutes. The latency is the expected reporting delay (for example, caused by constraints of cloud vendors or other third-party data sources) between the observation of a metric data point and its availability in Dynatrace. The allowed value range is from 1 to 60 minutes. Metric expressions don't return this field. |
maximumValue | number | The maximum allowed value of the metric. Metric expressions don't return this field. |
metricId | string | The fully qualified key of the metric. If a transformation has been used it is reflected in the metric key. |
metricSelector | string | The metric selector that is used when querying a func: metric. |
metricValueType | MetricValueType | The value type for the metric. |
minimumValue | number | The minimum allowed value of the metric. Metric expressions don't return this field. |
resolutionInfSupported | boolean | If 'true', resolution=Inf can be applied to the metric query. |
rootCauseRelevant | boolean | The metric is ( A root-cause relevant metric represents a strong indicator for a faulty component. Metric expressions don't return this field. |
scalar | boolean | Indicates whether the metric expression resolves to a scalar ( |
tags | string[] | The tags applied to the metric. Metric expressions don't return this field. |
transformations | string[] | Transform operators that could be appended to the current transformation list.
|
unit | string | The unit of the metric. |
unitDisplayFormat | string | The raw value is stored in bits or bytes. The user interface can display it in these numeral systems: Binary: 1 MiB = 1024 KiB = 1,048,576 bytes Decimal: 1 MB = 1000 kB = 1,000,000 bytes If not set, the decimal system is used. Metric expressions don't return this field.
|
warnings | string[] | A list of potential warnings that affect this ID. For example deprecated feature usage etc. |
The MetricDefaultAggregation
object
The default aggregation of a metric.
Element | Type | Description |
---|---|---|
parameter | number | The percentile to be delivered. Valid values are between Applicable only to the |
type | string | The type of default aggregation.
|
The MetricDimensionCardinality
object
The dimension cardinalities of a metric.
Element | Type | Description |
---|---|---|
estimate | integer | The cardinality estimate of the dimension. |
key | string | The key of the dimension. It must be unique within the metric. |
relative | number | The relative cardinality of the dimension expressed as percentage |
The MetricDimensionDefinition
object
The dimension of a metric.
Element | Type | Description |
---|---|---|
displayName | string | The display name of the dimension. |
index | integer | The unique 0-based index of the dimension. Appending transformations such as :names or :parents may change the indexes of dimensions. |
key | string | The key of the dimension. It must be unique within the metric. |
name | string | The name of the dimension. |
type | string | The type of the dimension.
|
The MetricValueType
object
The value type for the metric.
Element | Type | Description |
---|---|---|
type | string | The metric value type
|
Response body JSON model
1{2 "aggregationTypes": [3 "auto",4 "value"5 ],6 "created": 1597400123451,7 "dduBillable": false,8 "defaultAggregation": {9 "type": "value"10 },11 "description": "Percentage of user-space CPU time currently utilized, per host.",12 "dimensionCardinalities": [13 {14 "estimate": 20,15 "key": "dt.entity.host",16 "relative": 0.217 }18 ],19 "dimensionDefinitions": [20 {21 "displayName": "Host",22 "index": 0,23 "key": "dt.entity.host",24 "name": "Host",25 "type": "ENTITY"26 }27 ],28 "displayName": "CPU user",29 "entityType": [30 "HOST"31 ],32 "lastWritten": 1597400717783,33 "latency": 1,34 "metricId": "builtin:host.cpu.user:splitBy(\"dt.entity.host\"):max:fold",35 "metricValueType": {36 "type": "unknown"37 },38 "scalar": false,39 "tags": [],40 "transformations": [41 "filter",42 "fold",43 "limit",44 "merge",45 "names",46 "parents",47 "timeshift",48 "rate",49 "sort",50 "last",51 "splitBy"52 ],53 "unit": "Percent"54}
Example
In this example, the request queries the parameters of three metrics: builtin:host.cpu.idle, builtin:host.cpu.usage, and builtin:host.disk.avail.
The builtin:host.cpu.idle and builtin:host.cpu.usage metrics have the same parent and their selector is combined into builtin:host.cpu.(idle,usage).
The response is in application/json
format.
Curl
1curl -L -X GET 'https://mySampleEnv.live.dynatrace.com/api/v2/metrics/builtin:host.disk.avail' \2-H 'Authorization: Api-Token dt0c01.abc123.abcdefjhij1234567890' \3-H 'Accept: application/json'
Request URL
1https://mySampleEnv.live.dynatrace.com/api/v2/metrics/builtin:host.disk.avail
Response body
1{2 "metricId": "builtin:host.disk.avail",3 "displayName": "Disk available",4 "description": "",5 "unit": "Byte",6 "entityType": [7 "HOST"8 ],9 "aggregationTypes": [10 "auto",11 "avg",12 "max",13 "min"14 ],15 "transformations": [16 "filter",17 "fold",18 "merge",19 "names",20 "parents"21 ],22 "defaultAggregation": {23 "type": "avg"24 },25 "dimensionDefinitions": [26 {27 "key": "dt.entity.host",28 "name": "Host",29 "index": 0,30 "type": "ENTITY"31 },32 {33 "key": "dt.entity.disk",34 "name": "Disk",35 "index": 1,36 "type": "ENTITY"37 }38 ]39}
The CSV table with header row looks like this. To obtain it, change the Accept header to text/csv; header=present
.
1metricId,displayName,description,unit,entityType,aggregationTypes,transformations,defaultAggregation,dimensionDefinitions2builtin:host.cpu.usage,CPU usage %,Percentage of CPU time currently utilized.,Percent,[HOST],"[auto, avg, max, min]","[filter, fold, merge, names, parents]",avg,[Host:ENTITY]
Response code
200