> ## 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.

# Correlate your costs with technical or business metrics

> Connect external metrics in Costory Integrations, then query usage metrics next to cloud cost in Advanced Explorer.

Billing explains what you spent. External metrics explain why. Connect a usage source in **Integrations**, then query it next to cloud cost in **Advanced Explorer**.

Use this when you need to:

* Reallocate shared infrastructure with a technical signal (requests, latency, schema size)
* Track unit economics (Financial metrics expressed on a per-unit basis: cost per customer, cost per API call, cost per transaction.) such as cost per active user or cost per transaction
* Overlay business activity (orders, sessions, pipeline runs) on the same chart as spend

![Add integration page showing the External metric section with AWS, GCP, Datadog, Amplitude, Tsuga, and Google Sheets](https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/add-integration-external-metrics.png?fit=max\&auto=format\&n=7N_qRRx_7ACcj7QT\&q=85\&s=9c59528a5772931faac45e405038bb02)

Add integration, External metric tiles for AWS, GCP, Datadog, Amplitude, Tsuga, and Google Sheets

## Add an external metric

**1. Open Add integration**

Go to [Integrations](https://app.costory.io/integration) and click **+ Add integration**.&#x20;

**2. Pick an External metric tile**

The page title is **Add integration**. The subtitle is **Choose a provider to connect billing or external metrics.** Tiles are split into **Billing** and **External metric**.

**3. Validate, then save**

Connect screens are two columns: instructions on the left, **Connection details** on the right. Click **Validate**. **Save connection** stays disabled until validation succeeds. [Custom metrics](https://docs.costory.io/setup/usage-metrics/custom-metrics-push.md) has no Validate step: **Save connection** creates the table.

After you save, the source appears under **Integrations** > **Data sources**. Most external metric sources use the **External metrics** badge. [Google Sheets](https://docs.costory.io/setup/usage-metrics/google-sheet.md) uses the **Metrics** badge. [Custom metrics](https://docs.costory.io/setup/usage-metrics/custom-metrics-push.md) uses the **Custom metrics** badge. A Datadog connection shows **metrics** and, if you enabled CI Visibility, **metrics\_ci**.

![Integrations Data sources list showing Docs Datadog, Tsuga, BigQuery, a Google Sheet, and billing datasources](https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/integrations-datasources-with-datadog.png?fit=max\&auto=format\&n=7N_qRRx_7ACcj7QT\&q=85\&s=bd65a15ff233474f18d0858164157474)

Integrations Data sources list with Datadog, External metrics, and Metrics badges

> [!NOTE]
>
> Query external metrics in **Advanced Explorer** only. Open **Explore your data**, then switch **Classic** to **Advanced**. Classic greys out non-cost metrics.

## External metric providers

> [card] [AWS CloudWatch](https://docs.costory.io/setup/usage-metrics/aws-cloudwatch.md)
>
> CloudWatch metrics. Sub-choice on the AWS tile.

> [card] [GCP Cloud Monitoring](https://docs.costory.io/setup/usage-metrics/gcp-cloud-monitoring.md)
>
> Live GCP metrics. Sub-choice on the GCP tile.

> [card] [S3 metrics](https://docs.costory.io/setup/usage-metrics/s3-parquet.md)
>
> Parquet files from S3. Sub-choice on the AWS tile.

> [card] [BigQuery](https://docs.costory.io/setup/usage-metrics/bigquery.md)
>
> Any BigQuery table, queried live.

> [card] [BigQuery jobs (beta)](https://docs.costory.io/setup/usage-metrics/bigquery-jobs.md)
>
> Reallocate slots to the user who ran the query. On-demand and reservations in one view.

> [card] [Datadog](https://docs.costory.io/setup/usage-metrics/datadog.md)
>
> Standard metrics. Same connect page as billing.

> [card] [Datadog CI Visibility](https://docs.costory.io/setup/usage-metrics/datadog-ci.md)
>
> CI and pipeline visibility. Same Datadog connect page.

> [card] [Amplitude](https://docs.costory.io/setup/usage-metrics/amplitude.md)
>
> Active users, new users, WAU, and MAU, queried live.

> [card] [Tsuga](https://docs.costory.io/setup/usage-metrics/tsuga.md)
>
> Live cluster metrics, logs, and traces.

> [card] [Google Sheets](https://docs.costory.io/setup/usage-metrics/google-sheet.md)
>
> Numeric columns from a spreadsheet.

> [card] [Snowflake](https://docs.costory.io/setup/usage-metrics/snowflake.md)
>
> Tables from a database on your existing Snowflake integration.

> [card] [Custom metrics](https://docs.costory.io/setup/usage-metrics/custom-metrics-push.md)
>
> Hourly points you POST with an organization API key.

GCS Inventory is not on the **External metric** grid. See [GCS Inventory](https://docs.costory.io/setup/usage-metrics/gcs-inventory.md) for what to use instead.

## Query after you connect

**1. Open Advanced Explorer**

Click **Explore your data** in the sidebar, then switch **Classic** to **Advanced**.

**2. Add a metric**

Click **+ Add Metric**. In the metric picker, use the chips **cost**, **usage**, **metric**, **budget**, and **integrations**.

![Advanced Explorer metric picker open on Cost, with integrations listing Tsuga and BigQuery](https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/explorer-metric-picker.png?fit=max\&auto=format\&n=7N_qRRx_7ACcj7QT\&q=85\&s=83a364e7392e46a8df87ec385843e3f9)

Metric picker chips: cost, usage, metric, budget, and integrations

**3. Pick the integration**

Open **integrations**, then choose the source you connected. Helper text describes it as a live external usage metric.

**4. Configure the series**

For BigQuery, choose a **table**, then set **Date field**, **Value column**, **Aggregate** (for example **SUM**), **Gap fill** (**FORWARD FILL**, **ZERO**, or **LINEAR**), and optional **Group by**.

![Select metric dropdown listing BigQuery tables such as demo\_raw.artifact\_registry and demo\_raw.aws\_ec2](https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/explorer-table-picker.png?fit=max\&auto=format\&n=7N_qRRx_7ACcj7QT\&q=85\&s=72f9ac21292f4f27c3ab6d0382e60619)

BigQuery table picker after you select the BigQuery integration

**5. Fix an empty chart**

If the chart is empty, pick a different table and change **Period**. Options include Custom dates, Trailing 7 / 30 / 45 / 90 Days, MTD, QTD, YTD, Last Week, Last Month, Last 3 / 6 / 12 months, and Last Invoice Month.

![Advanced Explorer Period menu listing Custom dates, trailing ranges, MTD, QTD, YTD, and Last Invoice Month](https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/explorer-period-dropdown.png?fit=max\&auto=format\&n=7N_qRRx_7ACcj7QT\&q=85\&s=7c5f901ae6651511c71163f3bb3254c2)

Period dropdown with Trailing 45 Days selected

In the demo workspace, `demo_raw.artifact_*` tables stayed empty at every range. `demo_raw.raw_v2` with **Trailing 90 Days** rendered using date `billing_period_end`, value `billed_cost`, **SUM**, and **FORWARD FILL**.

![Advanced Explorer bar chart of Externalmetric from BigQuery demo\_raw.raw\_v2 over Trailing 90 Days](https://mintcdn.com/costory/7N_qRRx_7ACcj7QT/images/external-metrics/explorer-chart-raw-v2.png?fit=max\&auto=format\&n=7N_qRRx_7ACcj7QT\&q=85\&s=ee158e91580b31d7e8b0ddf9a5685f1c)

External metric chart for demo\_raw\.raw\_v2 with billed\_cost SUM and FORWARD FILL

**6. Add cost or a formula**

Optionally click **+ Add Metric** for **Cost**, then **+ Add Formula** such as `b / a`.

See [BigQuery](https://docs.costory.io/setup/usage-metrics/bigquery.md) for the live table picker and a worked query. See [Unit Economics](https://docs.costory.io/features/unit-economics.md) for formula patterns, or [cost per active user](https://docs.costory.io/use-cases/amplitude/cost_per_active_users.md) and [shared Cloud SQL allocation](https://docs.costory.io/use-cases/allocate_shared_cloud_sql_database/allocate.md) for end-to-end examples.

## Related pages

> [card] [Unit Economics](https://docs.costory.io/features/unit-economics.md)
>
> Combine cost with external metrics in Explorer formulas.

> [card] [Shared Cost Allocation](https://docs.costory.io/features/tagging/shared-cost-allocation.md)
>
> Split shared infrastructure using a usage metric.

> [card] [Explorer](https://docs.costory.io/features/cost-explorer.md)
>
> Query cost, usage, and formulas in one chart.

> [card] [Billing Data](https://docs.costory.io/setup/billing)
>
> Connect AWS, GCP, Azure, and SaaS invoices first.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.