Metrics API - GET all metrics

Lists all available metrics.

You can limit the output by using the pagination:

  1. Specify the number of results per page in the pageSize query parameter.
  2. Then use the cursor from the nextPageKey field of the previous response in the nextPageKey query parameter to obtain subsequent pages.

The request produces an application/json payload.

GET
  • Managed https://{your-domain}/e/{your-environment-id}/api/v2/metrics
  • SaaS https://{your-environment-id}.live.dynatrace.com/api/v2/metrics

Parameters

Parameter Type Description In Required
nextPageKey string

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.

query optional
pageSize integer

The desired amount of primary entities for which data is delivered in a single response payload.

The maximal allowed page size is 1000.

If not set, 100 is used.

query optional
metricSelector string

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, you can use this shorthand: 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, you could write: builtin:host.cpu.(idle,user).

You can set additional transformation operators, separated by a colon (:). See the Metrics API - selector transformations help page for additional information on available result transformations.

Use a trailing asterisk to select a complete hierarchy of metrics, e.g. builtin:* selects all Dynatrace-provided metrics. To find metrics based on a search term, rather than hierarchical, use the text parameter instead of this one.

The length of the string is limited to 1,000 characters.

query optional
text string

Metric registry search term. Only show metrics that contain the term in their ID, 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.

query optional
fields string

Defines the list of metric properties included in the response.

metricId is always included in the result. The following additional properties are available:

  • displayName: The name of the metric in the user interface. Enabled by default.
  • description: A short description of the metric. Enabled by default.
  • unit: The unit of the metric. Enabled by default.
  • aggregationTypes: The list of allowed aggregations for the metric. Note that it may be different after a transformation is applied.
  • defaultAggregation: The default aggregation of the metric. It is used when no aggregation is specified or the :auto transformation is set.
  • dimensionDefinitions: The fine metric division (for example, process group and process ID for some process-related metric).
  • transformations: A list of transformations that can be applied to the metric.
  • dimensionDefinitions: A list of dimensions available for the metric.
  • entityType: A list of entity types supported by the metric.

To add properties, list them with leading plus +. 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.

query optional

Response format

The MetricsList object

A list of metrics along with their descriptors.

Element Type Description
totalCount integer

The estimated number of metrics in the result.

nextPageKey string

The cursor for the next page of results. Has the value of null on the last page.

Use it in the nextPageKey query parameter to obtain subsequent pages of the result.

metrics MetricDescriptor[]

A list of metric along with their descriptors

The MetricDescriptor object

The descriptor of a metric.

Element Type Description
metricId string

The fully qualified key of the metric.

If a transformation has been used it is reflected in the metric key.

entityType string[]

List of admissible primary entity types for this metric. Can be used for the type predicate in the entitySelector.

aggregationTypes string[]

The list of allowed aggregations for this metric.

defaultAggregation MetricDefaultAggregation
dimensionDefinitions MetricDimensionDefinition[]

The fine metric division (for example, process group and process ID for some process-related metric).

description string

A short description of the metric.

transformations string[]

Transform operators that could be appended to the current transformation list. Must be enabled with the "fields" parameter on /metrics and is always present on /metrics/{metricId}.

unit string

The unit of the metric.

displayName string

The name of the metric in the user interface.

The MetricDimensionDefinition object

The dimension of a metric.

Element Type Description
index integer

The unique 0-based index of the dimension.

Appending transformations such as :names or :parents may change the indexes of dimensions.

name string

The name of the dimension.

It must be unique within the metric.

type string

The type of the dimension.

The MetricDefaultAggregation object

The default aggregation of a metric.

Element Type Description
parameter number

The percentile to be delivered. Valid values are between 0 and 100.

Applicable only to the percentile aggregation type.

type string

The type of default aggregation.