---
title: "Get all span-based metrics"
method: GET
path: "/api/v2/apm/config/metrics"
tags: ["Spans Metrics"]
---

# Get all span-based metrics

`GET /api/v2/apm/config/metrics`

Get the list of configured span-based metrics with their definitions.

## Response `200`

OK

- SpansMetricsResponse — All the available span-based metric objects.
  - `data` SpansMetricResponseData[] — A list of span-based metric objects.
    - `attributes` SpansMetricResponseAttributes — The object describing a Datadog span-based metric.
      - `compute` SpansMetricResponseCompute — The compute rule to compute the span-based metric.
        - `aggregation_type` 'count' | 'distribution' — The type of aggregation to use.
        - `include_percentiles` boolean — Toggle to include or exclude percentile aggregations for distribution metrics. Only present when the `aggregation_type` is `distribution`.
        - `path` string — The path to the value the span-based metric will aggregate on (only used if the aggregation type is a "distribution").
      - `filter` SpansMetricResponseFilter — The span-based metric filter. Spans matching this filter will be aggregated in this metric.
        - `query` string — The search query - following the span search syntax.
      - `group_by` SpansMetricResponseGroupBy[] — The rules for the group by.
        - `path` string — The path to the value the span-based metric will be aggregated over.
        - `tag_name` string — Eventual name of the tag that gets created. By default, the path attribute is used as the tag name.
    - `id` string — The name of the span-based metric.
    - `type` 'spans_metrics' — The type of resource. The value should always be spans_metrics.

## Other responses

- `403` — Not Authorized
- `429` — Too many requests

---

[API](https://skmtc.net/datadog/apis/api-v2.md) · [All operations](https://skmtc.net/datadog/apis/api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/datadog/api-v2/revisions/da68bf029e4c/schema)
