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

# Dimensions

> Create cloud cost allocation dimensions that merge native AWS, GCP, and Azure tags, normalize values, and define rule-based virtual dimensions for team, product, or environment reporting.

**Dimensions** are Costory reporting fields. They map provider-specific tags, labels, and billing metadata to consistent values you can group, filter, allocate, alert, and report on across AWS, GCP, and Azure.

Costory resolves dimensions on top of your billing export and recomputes history on every change, so a dimension reads the same in [Explorer](/features/cost-explorer), dashboards, alerts, and reports. The UI and the [Costory MCP](/features/mcp) write the same definitions: rules you build in the app are the same CEL conditions an agent drafts and publishes through the virtual dimension tools.

<Frame caption="Dimensions page listing imported labels and virtual dimensions in one place">
  <img src="https://mintcdn.com/costory/ZRQ99Ovx-9xOnLCN/images/dimensions-import/01-dimensions-list.png?fit=max&auto=format&n=ZRQ99Ovx-9xOnLCN&q=85&s=885098c5f63dbe96f62ead0822efb9b8" alt="Costory Dimensions page listing imported labels and virtual dimensions" width="1620" height="954" data-path="images/dimensions-import/01-dimensions-list.png" />
</Frame>

## Overview

There are two kinds of dimension.

An **imported dimension** points several native tags or labels at the same concept. Map `aws:Environment`, `env`, and `environment` into one `Environment` dimension so filters and splits stay consistent across providers.

A **virtual dimension** derives its values from rules instead of an existing tag. Each rule is a CEL condition evaluated top to bottom, first match wins. A `Team` virtual dimension can route rows where `cos_gcp_project_id.startsWith("eng-")` to `Engineering` and send everything else to a leftover bucket.

Common uses:

* Collapse duplicate tag keys across AWS, GCP, and Azure into one field
* Normalize values such as `prod`, `prd`, and `production`
* Allocate untagged resources to teams, products, or cost centers
* Build shared dashboards, alerts, and reports on stable business fields

## Key terms used in this article

* **Dimension**: A Costory reporting field used to filter, group, allocate, or scope costs.
* **Imported dimension**: A dimension built from native provider tags, labels, or billing metadata.
* **<Tooltip tip="Rule-based dimensions whose output values are defined in Costory." cta="See Glossary" href="/docs/glossary#virtual-dimensions">Virtual dimension</Tooltip>**: A dimension whose values come from CEL rules you define in Costory.
* **Leftover bucket**: The automatic catch-all value for any row that matches no rule. A large leftover share signals a missing or too-narrow rule.

See the [Glossary](/docs/glossary) for a full list of terms.

## Create a dimension from native tags and labels

Use imported dimensions when the data already exists in your cloud billing export, but the names or values are inconsistent.

<Steps>
  <Step title="Open Dimensions">
    Navigate to **Dimensions** from the left sidebar.
  </Step>

  <Step title="Add a dimension">
    Click **+ Add new dimension**, then select the native tags or labels you want to merge.

    <Frame caption="Select source tags and labels from AWS, GCP, and Azure">
      <img src="https://mintcdn.com/costory/ZRQ99Ovx-9xOnLCN/images/dimensions-import/02-select-namespace-tag.png?fit=max&auto=format&n=ZRQ99Ovx-9xOnLCN&q=85&s=7f21830e675af20eab8e46a3d8c8fa8f" alt="Selecting native tag and label sources to create a Costory dimension" width="1620" height="954" data-path="images/dimensions-import/02-select-namespace-tag.png" />
    </Frame>
  </Step>

  <Step title="Choose the reporting name">
    Pick the name you want Costory users to see, such as `environment`, `team`, or `cost_center`.
  </Step>

  <Step title="Normalize values">
    Review suggested value mappings and adjust them. For example, map `prod`, `prd`, and `production` to `production`.

    <Frame caption="Remap variant values to one canonical value per dimension">
      <img src="https://mintcdn.com/costory/42bBN-TVANXyiZnv/images/dimensions-import/remap-dimensions.png?fit=max&auto=format&n=42bBN-TVANXyiZnv&q=85&s=f7df9900c3ff3d716f5c5c0d912ddb8c" alt="Environment dimension editor remapping values to canonical names" width="1108" height="509" data-path="images/dimensions-import/remap-dimensions.png" />
    </Frame>
  </Step>

  <Step title="Publish">
    Click **Publish all changes**. Costory reprocesses historical data so the dimension is available in [Explorer](/features/cost-explorer), [Dashboards](/features/dashboards), [Alerts](/features/alerts), and [Reports](/features/slack-reports).
  </Step>
</Steps>

## Create a virtual dimension from rules

Use virtual dimensions when the right grouping does not exist as a clean tag. Rules can use billing metadata, imported dimensions, or other virtual dimensions.

<Steps>
  <Step title="Create the virtual dimension">
    Open **Dimensions**, click **+ Add new dimension** > **Virtual dimension**, and enter a name such as `team`, `business_unit`, or `product`.

    <Frame caption="Add a virtual dimension from the Dimensions page">
      <img src="https://mintcdn.com/costory/ZRQ99Ovx-9xOnLCN/images/dimensions-virtual/01-add-menu-virtual-dimension.png?fit=max&auto=format&n=ZRQ99Ovx-9xOnLCN&q=85&s=66754a5e14290f8d74f00350733c9491" alt="Dimensions page with Add new dimension menu showing Dimension and Virtual dimension options" width="1620" height="954" data-path="images/dimensions-virtual/01-add-menu-virtual-dimension.png" />
    </Frame>
  </Step>

  <Step title="Define rules">
    Add conditions that map cost rows to output values. Conditions can use fields such as account, service, resource name, Kubernetes namespace, imported dimensions, or another virtual dimension.

    <Frame caption="Rules editor with conditions and value mapping">
      <img src="https://mintcdn.com/costory/ZRQ99Ovx-9xOnLCN/images/dimensions-virtual/03-rules-editor-new-virtual-dim.png?fit=max&auto=format&n=ZRQ99Ovx-9xOnLCN&q=85&s=8900310fffae9c428d1ec6ab80e69c12" alt="Virtual dimension rules editor with conditions and output value mapping" width="1620" height="954" data-path="images/dimensions-virtual/03-rules-editor-new-virtual-dim.png" />
    </Frame>
  </Step>

  <Step title="Order the rules">
    Rules are evaluated from top to bottom. Drag rules into the priority order you want.
  </Step>

  <Step title="Save">
    Costory reprocesses historical data and makes the new values available across the product.
  </Step>
</Steps>

Every virtual dimension ends with a **leftover bucket**: a catch-all value for any cost row that matches none of your rules. Watch its share when you build rules: a large leftover usually means a rule is missing or too narrow.

## Explore and build allocation with your AI assistant

Most of the work in allocation is deciding which field to split on, not entering the rules. Through the [Costory FinOps MCP](/features/mcp), an assistant runs that exploration against your real spend and turns the result into a published dimension from chat. Before any rule exists, it can:

* Surface the values behind a concept with semantic search. Ask for "checkout" and you also get `payment-api`, `order-service`, and `cart-backend`, so one rule covers related spend a literal match would miss.
* Test which field best separates your cost with group-by suggestions and ad-hoc queries, so you split on something meaningful instead of guessing.
* Preview where the money lands. A per-rule preview shows trailing-30-day cost per bucket and the leftover share, so a missing or too-narrow rule is obvious before you publish.
* Flag rules that overlap. The overlap matrix shows when a broad early rule shadows a later one and swallows its spend.

Creating the dimension is the easy last step. The assistant drafts the rules as CEL conditions (top to bottom, first match wins), adds the leftover bucket automatically, and keeps everything on a **draft**. Publishing is explicit and triggers a data refresh, so production stays unchanged until you confirm.

<Tip>
  Describe the outcome you want ("split our shared Cloud SQL bill across teams by schema size") and let the assistant explore the data and propose rules. Review the preview, especially the leftover share, before approving the publish.
</Tip>

See the [FinOps MCP reference](/features/mcp#virtual-dimensions) for the underlying tools and parameters.

## Reallocate shared cost with a usage metric

Beyond mapping rows to fixed values, a virtual dimension rule can split a shared cost **proportionally** across teams based on a synced usage metric, a **telemetry** allocation. For example, divide a shared Cloud SQL bill across teams by each schema's size instead of guessing a flat percentage.

Connect a metric source in [Setup > Usage Metrics](/setup/usage-metrics), then add the allocation rule from the web app or through MCP. See [Shared Cost Allocation](/features/tagging/shared-cost-allocation) for the full walkthrough and supported sources.

## Dimension sources

| Source                 | Examples                                        | When to use                                                                                             |
| ---------------------- | ----------------------------------------------- | ------------------------------------------------------------------------------------------------------- |
| Native tags and labels | `env`, `aws:Environment`, `project.labels.team` | You already tag resources, but names or values differ by provider                                       |
| Standard columns       | Provider, account, service, region, namespace   | You need allocation from billing metadata that is always present                                        |
| Other dimensions       | `environment`, `team`, `business_unit`          | You want a hierarchy, such as namespace -> team -> business unit                                        |
| Usage metrics          | Database size, API calls, CPU time              | You need [shared cost allocation](/features/tagging/shared-cost-allocation) based on actual consumption |

## Common patterns

### Environment dimension

Merge `env`, `environment`, and `k8s_label_env`, then normalize values into `development`, `staging`, and `production`. Use this for environment cost reports and alerts.

### Team virtual dimension

Map accounts, namespaces, services, and project IDs to teams. This helps you allocate untagged resources and create team scopes in [Teams](/features/teams).

### Allocation hierarchy

Build one dimension on top of another. For example:

```mermaid theme={null}
graph LR
    A[Kubernetes namespace] --> B[Team]
    B --> C[Business unit]
    C --> D[P&L line]
```

When the team mapping changes, every dashboard, alert, and report that uses the downstream dimensions updates after reprocessing.

## Next Steps

<CardGroup cols={2}>
  <Card title="Tag & Allocate overview" icon="tags" href="/features/tagging">
    See how dimensions and shared cost allocation fit together
  </Card>

  <Card title="Shared Cost Allocation" icon="chart-pie" href="/features/tagging/shared-cost-allocation">
    Split shared infrastructure costs with usage metrics
  </Card>

  <Card title="Explorer" icon="magnifying-glass" href="/features/cost-explorer">
    Use dimensions to filter and group cost data
  </Card>

  <Card title="Automated Environment Visibility" icon="eye" href="/use-cases/automated_env_allocation/visibility">
    Walk through an environment dimension example
  </Card>

  <Card title="Explore allocation with AI (MCP)" icon="robot" href="/features/mcp#virtual-dimensions">
    Explore your spend and build virtual dimensions from chat
  </Card>
</CardGroup>
