> For the complete documentation index, see [llms.txt](https://docs.mediarithmics.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mediarithmics.io/setup-and-monitor/operate-and-monitor/monitor-resource-usage.md).

# Monitor resource usage

Report on what your datamart consumes: the cost of each query, and the volume ingested.

## Your goal

Understand what your datamart consumes - which queries cost what, and how much data you ingest - so consumption is a number you manage rather than a surprise.

## Expected outcome

A consumption report per datamart that you can break down by resource and follow over time.

## What is measured

**Each datamart resource that leads to write or read access on the platform is tracked, and its consumption is measured** - segments, exports, imports, and the rest.

The report gives you:

* **the cost of each query executed** on the platform,
* **the amount of data ingested**.

## Read the report

The endpoint is a mediarithmics **data cube**, like the other monitoring APIs.

```
POST https://api.mediarithmics.com/v1/platform_monitoring/resources_usage
```

| Field                      | Type   | Description                                                                        |
| -------------------------- | ------ | ---------------------------------------------------------------------------------- |
| `metrics`                  | Array  | The metrics to retrieve. **Required.**                                             |
| `dimensions`               | Array  | The dimensions to group by. **Required.**                                          |
| `dimension_filter_clauses` | Object | Filters on dimensions before calculating the metric. **Required.**                 |
| `date_ranges`              | Array  | The periods to analyse - each with a `start_date` and an `end_date`. **Required.** |

The response is a report view with `columns_headers` and `rows`, in the same shape as the other data cubes. The available dimensions and metrics are the same reference as for [collection volumes](/setup-and-monitor/operate-and-monitor/monitor-collection-volume.md).

## Retention

{% hint style="info" %}
These aggregated statistics are kept for **two years**.
{% endhint %}

## What to do with it

{% stepper %}
{% step %}

### Find the expensive queries

Query cost is where consumption usually concentrates. A segment recomputed nightly on an expensive query costs every night; a [computed field](/setup-and-monitor/collect-and-manage-your-data/design-your-data-model-and-schema/computed-fields.md) that replaces several directives moves the work off the query path.
{% endstep %}

{% step %}

### Check ingestion against your plan

Compare the volume ingested with what your tracking plan intends. An unexpected volume usually means an event is being sent more often than designed - not that usage grew.
{% endstep %}

{% step %}

### Review what is indexed

Every indexed property costs index size and query performance. If consumption grows without a use case behind it, the schema is the place to look. See [Schema definition](/setup-and-monitor/collect-and-manage-your-data/design-your-data-model-and-schema/schema-definition.md).
{% endstep %}

{% step %}

### Compare against the documented limits

Several platform limits are defaults that can be raised, and knowing your actual consumption is what makes that conversation concrete. See [Platform limits](/setup-and-monitor/plan-and-integrate/set-up-the-environment/platform-limits.md).
{% endstep %}
{% endstepper %}

## Related pages

<table data-view="cards" data-search="false"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Monitor collection volume</strong></td><td>What is indexed in each collection.</td><td><a href="/setup-and-monitor/operate-and-monitor/monitor-collection-volume.md">Monitor collection volume</a></td></tr><tr><td><strong>Platform limits</strong></td><td>The documented ceilings and defaults.</td><td><a href="/setup-and-monitor/plan-and-integrate/set-up-the-environment/platform-limits.md">Platform limits</a></td></tr><tr><td><strong>Query your datamart</strong></td><td>Where query cost comes from.</td><td><a href="/setup-and-monitor/operate-and-monitor/query-your-datamart.md">Query your datamart</a></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.mediarithmics.io/setup-and-monitor/operate-and-monitor/monitor-resource-usage.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
