---
title: Ingesting Metrics
description: Import precomputed metrics from your data warehouse using Statsig's connector integrations.
product: general
token_estimate: 881
---
# Ingesting Metrics

> For AI agents: a documentation index is available at [/llms.txt](/llms.txt). Append `.md` to any page URL for markdown, or send `Accept: text/markdown`.

Statsig can ingest your precomputed product and business metrics using the data warehouse connector (Metrics Imports). Statsig supports integrations with [Snowflake](https://docs.statsig.com/integrations/data-imports/snowflake), [BigQuery](https://docs.statsig.com/integrations/data-imports/bigquery), and [Redshift](https://docs.statsig.com/integrations/data-imports/redshift).

Statsig doesn't automatically process these metrics until you mark them as ready, because you might load data out of order. After you finish loading data for a period, mark the data as ready by calling the `mark_data_ready` API.

```plaintext
curl --location --request POST ‘https://api.statsig.com/v1/mark_data_ready’ \
--header ‘statsig-api-key: {your statsig server secret}’ \
--header ‘Content-Type: application/json’ \
--data-raw ‘{
    “timestamp”: 1647975283,
    “type”: “metrics”
}
```

The timestamp provided should be:

- A unix timestamp
- The latest point in time for which you've uploaded all metrics

Any future calls to this API with an earlier timestamp are invalid. Statsig doesn't guarantee correct behavior if you provide metrics with an earlier timestamp after calling this API.

Statsig processes metrics as a full day in the PST timezone, and waits until you mark a full day as ready before processing that day.

## Debugging precomputed metrics

All precomputed metrics generate Metric Detail View pages. These Detail View pages take a few hours to generate after ingestion. The fastest way to start viewing and debugging your precomputed metrics is through the **Metrics Logstream** on the **Metrics Catalog** tab within **Metrics**.

![Metrics catalog displaying logstream entries for ingested metrics](https://docs.statsig.com/images/metrics/ingest/178854882-730ef0d5-8eb2-4344-88ab-33111301e712.png)

The **Metrics Logstream** surfaces all ingested, precomputed metrics in real time, enabling you to check metric name, value, ID, ID type, and ingestion date. A common issue is ensuring precomputed metrics have the correct ID type, so pay extra attention to this column.

You can also include test metrics tagged with **isTest**, which you can toggle on or off for debugging in the **Metrics Logstream**. The **isTest** flag works only for precomputed metrics ingested through Statsig's APIs. Support for this flag through integrations with Snowflake, BigQuery, and Redshift is coming soon.

To mark a batch of metrics as test metrics, set the `isTest` parameter to `true` in the request data, as shown below.

```bash
curl \
  “https://events.statsigapi.net/v1/log_custom_metric” \
  --header “statsig-api-key: <YOUR-SDK-KEY>” \
  --header “Content-Type: application/json” \
  --request POST \
  --data “{"isTest": true, “metrics": [{"user_id": "1237", "metric_name": "test_metric", "id_type": "user_id", "metric_value": 90}, {"user_id": "4568", "metric_name": "ratio", "id_type": "stable_id", "numerator": 3, "denominator": 15}]}”
```

![Metrics logstream UI showing isTest flag toggle](https://docs.statsig.com/images/metrics/ingest/179048336-ebdde45b-17e7-47ad-bb81-01f8f032b978.png)

The **Metrics Logstream** only appears if you're actively ingesting precomputed metrics. If it doesn't appear at the bottom of your **Metrics Catalog**, a connection or schema issue may be preventing Statsig from receiving your precomputed metrics.

