---
title: "Get metric"
method: GET
path: "/api/v2/experiments/metrics/{metric_id}"
tags: ["Experiments"]
---

# Get metric

`GET /api/v2/experiments/metrics/{metric_id}`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/experiments/metrics/{metric_id}`
- Auth: one of:
  - API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`
  - OAuth 2
    - Authorization code: `/oauth2/v1/authorize`
    - Token URL: `/oauth2/v1/token` scopes: `product_analytics_metrics_read`
- TypeScript: <https://skmtc.dev/datadog/apis/datadog-api-v2-collection/docs/api/v2/experiments/metrics/:metric_id/get.ts> (a function with typed inputs; its response is checked against the schema)

Get a metric. Returns a single experiment metric by its ID for the organization.

## Path parameters

- `metric_id` string, uuid, required: The UUID of the metric.

## Query parameters

- `include` string[]: Optional fields to include. Repeat this parameter to request several fields. `counts` adds experiment_count: how many experiments currently reference this metric.

## Response `200`

OK

- ExperimentsMetricV2DTO: Response containing the metric.
  - `data` ExperimentsMetricV2DTOData, required: JSON:API resource containing the metric identity and fields.
    - `attributes` ExperimentsMetricV2DTODataAttributes: Details of the metric.
      - `certified_at` string, date-time, nullable: Time when this resource was certified.
      - `created_at` string, date-time: Time when this resource was created.
      - `data_source_type` 'DATADOG' | 'DATADOG_REFERENCE_TABLE' | 'CUSTOMER_WAREHOUSE' | 'IMPORTED' | 'UNKNOWN': Source of the data used to calculate the metric.
      - `denominator_aggregation` ExperimentsMetricV2DTODataAttributesNumeratorAggregation, nullable: Source measure and aggregation settings for a metric value.
        - `aging_threshold_days` integer: Stored aging threshold in days. The subject aging filter uses the aggregation window end and unit.
        - `datadog_metric_measure` ExperimentsMetricV2DTODataAttributesPercentileAggregationDatadogMetricMeasure: 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` unknown
          - `name` string: Display name of the Datadog measure.
          - `query` string: Query used to retrieve the Datadog measure.
          - `source_definition_filter` unknown
          - `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` ExperimentsMetricPropertyFilterGroup[]: Filters applied to the metric aggregation.
          - ExperimentsMetricPropertyFilter[]: Metric property filters combined with AND.
            - `measure_id` string: ID of the measure evaluated by the filter.
            - `operation` string: Comparison applied by the filter.
            - `property_id` string: ID of the property evaluated by the filter.
            - `values` string[]: Values used by the filter's comparison.
        - `threshold_aggregation_type` string: Aggregation used to evaluate the threshold.
        - `threshold_breach_value` number, 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` number, double: Size of the threshold evaluation window.
        - `timeframe_end_value` number, double: End of the aggregation window in the specified time unit.
        - `timeframe_start_value` number, double: Start of the aggregation window in the specified time unit.
        - `timeframe_unit` string: Time unit used for the aggregation window.
        - `warehouse_metric_measure` ExperimentsMetricV2DTODataAttributesPercentileAggregationWarehouseMetricMeasure: 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` number, double: Fixed lower bound used to cap metric values.
        - `winsor_lower_percentile` number, double: Percentile used to determine the lower bound for capped metric values.
        - `winsor_upper_fixed_value` number, double: Fixed upper bound used to cap metric values.
        - `winsor_upper_percentile` number, 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` 'METRIC_INCREASES' | 'METRIC_DECREASES' | 'UNKNOWN': Direction of metric change considered desirable.
      - `experiment_count` integer, nullable: Number of experiments that reference this resource.
      - `format_as_percent` boolean: Whether to display the metric value as a percentage.
      - `guardrail_cutoff_threshold` number, double, nullable: Threshold used when evaluating this metric as a guardrail.
      - `metric_type` 'SIMPLE' | 'RATIO' | 'PERCENTILE' | 'UNKNOWN': Type of metric calculation.
      - `migration_metadata` unknown
      - `name` string: Display name of the metric.
      - `numerator_aggregation` ExperimentsMetricV2DTODataAttributesNumeratorAggregation, nullable: Source measure and aggregation settings for a metric value.
        - `aging_threshold_days` integer: Stored aging threshold in days. The subject aging filter uses the aggregation window end and unit.
        - `datadog_metric_measure` ExperimentsMetricV2DTODataAttributesPercentileAggregationDatadogMetricMeasure: 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` unknown
          - `name` string: Display name of the Datadog measure.
          - `query` string: Query used to retrieve the Datadog measure.
          - `source_definition_filter` unknown
          - `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` ExperimentsMetricPropertyFilterGroup[]: Filters applied to the metric aggregation.
          - ExperimentsMetricPropertyFilter[]: Metric property filters combined with AND.
            - `measure_id` string: ID of the measure evaluated by the filter.
            - `operation` string: Comparison applied by the filter.
            - `property_id` string: ID of the property evaluated by the filter.
            - `values` string[]: Values used by the filter's comparison.
        - `threshold_aggregation_type` string: Aggregation used to evaluate the threshold.
        - `threshold_breach_value` number, 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` number, double: Size of the threshold evaluation window.
        - `timeframe_end_value` number, double: End of the aggregation window in the specified time unit.
        - `timeframe_start_value` number, double: Start of the aggregation window in the specified time unit.
        - `timeframe_unit` string: Time unit used for the aggregation window.
        - `warehouse_metric_measure` ExperimentsMetricV2DTODataAttributesPercentileAggregationWarehouseMetricMeasure: 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` number, double: Fixed lower bound used to cap metric values.
        - `winsor_lower_percentile` number, double: Percentile used to determine the lower bound for capped metric values.
        - `winsor_upper_fixed_value` number, double: Fixed upper bound used to cap metric values.
        - `winsor_upper_percentile` number, double: Percentile used to determine the upper bound for capped metric values.
        - `winsorization_strategy` string: Method used to cap extreme metric values.
      - `percentile_aggregation` ExperimentsMetricV2DTODataAttributesPercentileAggregation, nullable: Source measure and settings for a percentile metric.
        - `datadog_metric_measure` ExperimentsMetricV2DTODataAttributesPercentileAggregationDatadogMetricMeasure: 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` unknown
          - `name` string: Display name of the Datadog measure.
          - `query` string: Query used to retrieve the Datadog measure.
          - `source_definition_filter` unknown
          - `source_subtype` string: Subtype of the Datadog data source.
          - `source_type` string: Type of Datadog data source used for the measure.
        - `percentile` number, double: Percentile calculated from the selected measure.
        - `pipeline_column_suffix` string: Suffix used to identify this value in pipeline output columns.
        - `property_filters` ExperimentsMetricPropertyFilterGroup[]: Filters applied to the metric aggregation.
          - ExperimentsMetricPropertyFilter[]: Metric property filters combined with AND.
            - `measure_id` string: ID of the measure evaluated by the filter.
            - `operation` string: Comparison applied by the filter.
            - `property_id` string: ID of the property evaluated by the filter.
            - `values` string[]: Values used by the filter's comparison.
        - `warehouse_metric_measure` ExperimentsMetricV2DTODataAttributesPercentileAggregationWarehouseMetricMeasure: 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` string, date-time: Time when this resource was last updated.
    - `id` string, uuid, required: ID of the metric.
    - `type` 'metrics', required: The metric resource type.

## Other responses

- `400`: Malformed metric ID (not a valid UUID).
- `401`: Missing or invalid authentication.
- `403`: Authenticated caller lacks the product_analytics_metrics_read permission.
- `404`: No metric with this ID exists for the organization.
- `429`: Too many requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v2-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/revisions/3f70db624329?raw)
