> ## Documentation Index
> Fetch the complete documentation index at: https://docs.costory.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Datadog

> Query Datadog metrics with rollups and import them into Costory

<Tabs>
  <Tab title="Manual setup">
    1. Create a Datadog integration in **Integrations** (API key, application key, region).
    2. In Costory, go to **Metrics > Import new metrics datasource > Datadog**.
    3. Select the Datadog configuration.
    4. Provide a metric query **with a rollup** (example):
       * `avg:system.cpu.user{*} by {host}.rollup(avg, daily, 'UTC')`
    5. Validate and finalize the metrics definition.

    <Note>
      This connector imports Datadog metrics only. To import Datadog spend, set up [Datadog Billing](/setup/billing/datadog). A key can have `timeseries_query` access while billing data remains unavailable.
    </Note>

    ## API reference

    Costory queries Datadog metrics through the [Metrics API](https://docs.datadoghq.com/api/latest/metrics/):

    | Use case                                 | Endpoint                        | Required scope     |
    | ---------------------------------------- | ------------------------------- | ------------------ |
    | Timeseries metric queries (with rollups) | `POST /api/v2/query/timeseries` | `timeseries_query` |

    The base URL depends on your Datadog site (for example `https://api.datadoghq.com` for US1). Costory sends your API key and application key on every request.

    See [Query timeseries points](https://docs.datadoghq.com/api/latest/metrics/#query-timeseries-points) for request body fields and response format.
  </Tab>

  <Tab title="Terraform">
    Not supported.
  </Tab>
</Tabs>
