This product is not supported for your selected Datadog site. ().

List metrics

GET https://api.ap1.datadoghq.com/api/v2/experiments/metricshttps://api.ap2.datadoghq.com/api/v2/experiments/metricshttps://api.datadoghq.eu/api/v2/experiments/metricshttps://api.ddog-gov.com/api/v2/experiments/metricshttps://api.us2.ddog-gov.com/api/v2/experiments/metricshttps://api.uk1.datadoghq.com/api/v2/experiments/metricshttps://api.datadoghq.com/api/v2/experiments/metricshttps://api.us3.datadoghq.com/api/v2/experiments/metricshttps://api.us5.datadoghq.com/api/v2/experiments/metrics

Overview

List metrics. Returns a paginated list of the experiment metrics defined for the organization. This endpoint requires the product_analytics_metrics_read permission.

OAuth apps require the product_analytics_metrics_read authorization scope to access this endpoint.

Arguments

Query Strings

Name

Type

Description

include

array

Optional fields to include. Repeat this parameter to request several fields. counts adds experiment_count on each metric, which costs an extra aggregate query.

page[limit]

integer

Maximum number of results to return. Defaults to 25 when omitted, and is capped at 50 (larger values are clamped to 50). The response includes meta.page (with total) and pagination links.

page[offset]

integer

Number of results to skip for pagination. Defaults to 0 when omitted.

search

string

Find metrics whose names contain the search text, regardless of case.

sort

string

Sort field: name, created_at, or updated_at. Prefix with - for descending (for example, -created_at). A single field only; a comma-separated list is rejected. Defaults to created_at descending.

Response

OK

List of metric resources with pagination information.

Expand All

Field

Type

Description

data [required]

[object]

Resources returned in this response.

attributes

object

Details of the metric.

certified_at

date-time

Time when this resource was certified.

created_at

date-time

Time when this resource was created.

data_source_type

enum

Source of the data used to calculate the metric. Allowed enum values: DATADOG,DATADOG_REFERENCE_TABLE,CUSTOMER_WAREHOUSE,IMPORTED,UNKNOWN

denominator_aggregation

object

Source measure and aggregation settings for a metric value.

aging_threshold_days

int64

Stored aging threshold in days. The subject aging filter uses the aggregation window end and unit.

datadog_metric_measure

object

Datadog source and query that supply values for the metric.

column_name

string

Name of the Datadog event field used by this measure.

column_type

string

Data type of the source column.

filters

Conditions used to select the metric's source data.

name

string

Display name of the Datadog measure.

query

string

Query used to retrieve the Datadog measure.

source_definition_filter

Filter applied to the Datadog source definition.

source_subtype

string

Subtype of the Datadog data source.

source_type

string

Type of Datadog data source used for the measure.

enable_aging_subject_filter

boolean

Whether to exclude subjects whose observation time is shorter than the aggregation window.

operation

string

Aggregation applied to the selected measure.

pipeline_column_suffix

string

Suffix used to identify this value in pipeline output columns.

property_filters

[array]

Filters applied to the metric aggregation.

threshold_aggregation_type

string

Aggregation used to evaluate the threshold.

threshold_breach_value

double

Value used to determine whether the threshold is breached.

threshold_comparison_operator

string

Comparison applied between the aggregated value and the threshold.

threshold_timeframe_dimension

string

Time unit used for the threshold evaluation window.

threshold_timeframe_value

double

Size of the threshold evaluation window.

timeframe_end_value

double

End of the aggregation window in the specified time unit.

timeframe_start_value

double

Start of the aggregation window in the specified time unit.

timeframe_unit

string

Time unit used for the aggregation window.

warehouse_metric_measure

object

Warehouse measure that supplies values for the metric.

id

string

ID of the measure.

pipeline_column_suffix

string

Suffix used to identify this value in pipeline output columns.

winsor_lower_fixed_value

double

Fixed lower bound used to cap metric values.

winsor_lower_percentile

double

Percentile used to determine the lower bound for capped metric values.

winsor_upper_fixed_value

double

Fixed upper bound used to cap metric values.

winsor_upper_percentile

double

Percentile used to determine the upper bound for capped metric values.

winsorization_strategy

string

Method used to cap extreme metric values.

description

string

Text that explains the metric.

desired_change

enum

Direction of metric change considered desirable. Allowed enum values: METRIC_INCREASES,METRIC_DECREASES,UNKNOWN

experiment_count

int64

Number of experiments that reference this resource.

format_as_percent

boolean

Whether to display the metric value as a percentage.

guardrail_cutoff_threshold

double

Threshold used when evaluating this metric as a guardrail.

metric_type

enum

Type of metric calculation. Allowed enum values: SIMPLE,RATIO,PERCENTILE,UNKNOWN

migration_metadata

Metadata retained for resources imported from another system.

name

string

Display name of the metric.

numerator_aggregation

object

Source measure and aggregation settings for a metric value.

aging_threshold_days

int64

Stored aging threshold in days. The subject aging filter uses the aggregation window end and unit.

datadog_metric_measure

object

Datadog source and query that supply values for the metric.

column_name

string

Name of the Datadog event field used by this measure.

column_type

string

Data type of the source column.

filters

Conditions used to select the metric's source data.

name

string

Display name of the Datadog measure.

query

string

Query used to retrieve the Datadog measure.

source_definition_filter

Filter applied to the Datadog source definition.

source_subtype

string

Subtype of the Datadog data source.

source_type

string

Type of Datadog data source used for the measure.

enable_aging_subject_filter

boolean

Whether to exclude subjects whose observation time is shorter than the aggregation window.

operation

string

Aggregation applied to the selected measure.

pipeline_column_suffix

string

Suffix used to identify this value in pipeline output columns.

property_filters

[array]

Filters applied to the metric aggregation.

threshold_aggregation_type

string

Aggregation used to evaluate the threshold.

threshold_breach_value

double

Value used to determine whether the threshold is breached.

threshold_comparison_operator

string

Comparison applied between the aggregated value and the threshold.

threshold_timeframe_dimension

string

Time unit used for the threshold evaluation window.

threshold_timeframe_value

double

Size of the threshold evaluation window.

timeframe_end_value

double

End of the aggregation window in the specified time unit.

timeframe_start_value

double

Start of the aggregation window in the specified time unit.

timeframe_unit

string

Time unit used for the aggregation window.

warehouse_metric_measure

object

Warehouse measure that supplies values for the metric.

id

string

ID of the measure.

pipeline_column_suffix

string

Suffix used to identify this value in pipeline output columns.

winsor_lower_fixed_value

double

Fixed lower bound used to cap metric values.

winsor_lower_percentile

double

Percentile used to determine the lower bound for capped metric values.

winsor_upper_fixed_value

double

Fixed upper bound used to cap metric values.

winsor_upper_percentile

double

Percentile used to determine the upper bound for capped metric values.

winsorization_strategy

string

Method used to cap extreme metric values.

percentile_aggregation

object

Source measure and settings for a percentile metric.

datadog_metric_measure

object

Datadog source and query that supply values for the metric.

column_name

string

Name of the Datadog event field used by this measure.

column_type

string

Data type of the source column.

filters

Conditions used to select the metric's source data.

name

string

Display name of the Datadog measure.

query

string

Query used to retrieve the Datadog measure.

source_definition_filter

Filter applied to the Datadog source definition.

source_subtype

string

Subtype of the Datadog data source.

source_type

string

Type of Datadog data source used for the measure.

percentile

double

Percentile calculated from the selected measure.

pipeline_column_suffix

string

Suffix used to identify this value in pipeline output columns.

property_filters

[array]

Filters applied to the metric aggregation.

warehouse_metric_measure

object

Warehouse measure that supplies values for the metric.

id

string

ID of the measure.

pipeline_column_suffix

string

Suffix used to identify this value in pipeline output columns.

reference_url

string

URL with supporting information about the metric.

updated_at

date-time

Time when this resource was last updated.

id [required]

uuid

ID of the metric.

type [required]

enum

The metric resource type. Allowed enum values: metrics

default: metrics

links

object

Links for navigating a paginated result set.

first

string

URL of the first page of results.

last

string

URL of the last page of results.

next

string

URL of the next page of results.

prev

string

URL of the previous page of results.

self

string

URL of the current page of results.

meta

object

Pagination information for a list response.

page

object

Result counts and offsets for a page of results.

first_offset

int64

Offset of the first page of results.

last_offset

int64

Offset of the last page of results.

limit

int64

Maximum number of results returned in one page.

next_offset

int64

Offset of the next page of results.

offset

int64

Number of results skipped before this page.

prev_offset

int64

Offset of the previous page of results.

total

int64

Total number of matching results across all pages.

type

string

Pagination method used for this result set.

{
  "data": [
    {
      "attributes": {
        "created_at": "2024-01-01T12:00:00Z",
        "data_source_type": "CUSTOMER_WAREHOUSE",
        "description": "Share of sessions that reach the order confirmation page",
        "desired_change": "METRIC_INCREASES",
        "format_as_percent": true,
        "metric_type": "SIMPLE",
        "name": "Checkout conversion",
        "numerator_aggregation": {
          "operation": "sum",
          "pipeline_column_suffix": "agg001",
          "timeframe_start_value": 0,
          "warehouse_metric_measure": {
            "id": "550e8400-e29b-41d4-a716-446655440021",
            "pipeline_column_suffix": "rev001"
          }
        },
        "reference_url": "",
        "updated_at": "2024-01-01T12:00:00Z"
      },
      "id": "550e8400-e29b-41d4-a716-446655440002",
      "type": "metrics"
    }
  ]
}

Invalid query parameter: bad page[offset]/page[limit], or unknown sort field.

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Missing or invalid authentication (dd-api-key + dd-application-key headers, or a valid user session).

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Authenticated caller lacks the product_analytics_metrics_read permission.

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}

Too many requests

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

{
  "errors": [
    "Bad Request"
  ]
}

Code Example

                  # Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.us2.ddog-gov.com"https://api.uk1.datadoghq.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/experiments/metrics" \ -H "Accept: application/json" \ -H "Authorization: Bearer ${DD_BEARER_TOKEN}"