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

# Alerts

> Monitor cloud spend and custom formulas against one trigger condition, built in the UI or through the Costory MCP, with Slack, Teams, or email notifications.

**Alerts** watch your cost or usage data against one trigger condition and notify you in Slack, Microsoft Teams, or email when it is met.

The alert engine runs on the same query layer as [Explorer](https://docs.costory.io/features/cost-explorer.md). You define metric rows, write a `condition` expression, and Costory evaluates it on a fixed schedule. The UI and the [Costory MCP](https://docs.costory.io/features/mcp.md) use the same fields: anything you build in the app, an agent can create with `create_alert`, backtest with `preview_alert`, or list with `list_alerts`.

[Alerts walkthrough](https://www.youtube.com/embed/cI1pS00um1c)

Watch an alerts walkthrough

## Overview

Each alert has exactly one condition. That keeps evaluation predictable: the same expression you see in the builder is what runs in BigQuery and what the MCP tools accept.

Common uses:

* Catch a service-level spike before it compounds over the billing period
* Monitor one formula across every team or project with a single `groupBy` alert
* Track commitment coverage, marginal cost per user, or any ratio built from multiple metrics
* Get budget threshold notifications without manual spreadsheet checks

![Costory alerts page listing active cost alerts](https://mintcdn.com/costory/-o1PiYy0cwBDL_-a/images/alerts.gif?s=82b231c0ece9a1907ed025f164b87f5f)

Alerts list showing active cost and budget alerts

## Get started

> [!NOTE]
>
> To create an alert through Claude, describe the outcome: *"alert me on Slack if daily AWS spend goes over \$10k."* The agent builds the queries, backtests the condition, and returns the alert URL. The steps below match what happens in the UI.

**1. Open Alerts and create an alert**

Go to **Alerts** in the Costory app. Click **Create Alert** and pick a pre-built template, or start from a view in [Explorer](https://docs.costory.io/features/cost-explorer.md).

![Selecting an alert template in Costory](https://mintcdn.com/costory/VgOY4BJyTDVknUpv/images/alerts-templates.png?fit=max\&auto=format\&n=VgOY4BJyTDVknUpv\&q=85\&s=b2a3321e6da38af6f389a2fe4f2d0516)

Create an alert from a template or from Explorer

Common templates include Savings Plan coverage, Kubernetes waste ratio, and weekly cost change alerts.

**2. Build the formula**

In **Formula**, add one or more metric rows. Each row gets a letter (`a`, `b`, `c`) that you reference in the condition. Use a single row or combine several for ratios and comparisons.

Pick a trigger preset or write a custom condition. The guided UI compiles presets into the formula string the engine runs.

**3. Set scope and groupBy**

In **Configuration**, set filters, grouping, aggregation, and currency. If you add a `groupBy` dimension, Costory evaluates the condition independently for every group value. One alert can cover all teams or projects on that dimension.

When multiple groups breach on the same day, Costory batches them into one notification and keeps the largest breaches for review.

**4. Review the backtest**

In **Preview**, check the chart and notification preview. The simulator shows when your formula would have fired on historical data before you save. Dimmed markers on the chart indicate days when the condition was met but deduplication prevented a notification.

![7-day rolling relative change alert showing formula, preview chart with alert markers, and notification history](https://mintcdn.com/costory/-o1PiYy0cwBDL_-a/images/alerts-7-day-rolling-preview.png?fit=max\&auto=format\&n=-o1PiYy0cwBDL_-a\&q=85\&s=b60b72f6e2bee051b76845a4e81a9dd4)

Alert preview with backtest chart, notification history, and dedup markers

**5. Configure notifications and save**

Choose Slack, Microsoft Teams, or email recipients. Save the alert. It begins evaluating after the next data refresh.

## Example scenarios

Paste the condition formula into the alert builder, or describe the outcome to Claude and let it call `preview_alert` and `create_alert`.

| Example | Description | Formula |
| - | - | - |
| **Weekly spend spike** | Row `a`: total cloud cost for the scope you monitor. Fires when rolling 7-day spend rises more than 15% vs the prior week. The spend floor reduces low-volume noise. | `(rollingSum(a, 7, DAY) - timeShift(rollingSum(a, 7, DAY), 7, DAY)) / abs(timeShift(rollingSum(a, 7, DAY), 7, DAY)) > 0.15 and rollingSum(a, 7, DAY) > 1000` |
| **Savings Plan coverage** | Row `a`: Savings Plan covered cost. Row `b`: Savings Plan uncovered cost. Fires when coverage drops below 80%. | `a / (a + b) < 0.8` |
| **Per-team spend limit** | Row `a`: cloud cost for the services you monitor. Set `groupBy` to your team dimension in **Configuration**. Fires when any team's daily spend exceeds the cap. | `a > 5000` |
| **Daily spend cap** | Row `a`: total cloud cost for the scope you monitor. Fires when daily spend exceeds a fixed amount. | `a > 10000` |
| **Day-over-day spike** | Row `a`: total cloud cost for the scope you monitor. Fires when daily spend rises more than 10% vs the previous day. | `(a - timeShift(a, 1, DAY)) / abs(timeShift(a, 1, DAY)) > 0.1` |
| **Week-over-week jump** | Row `a`: total cloud cost for the scope you monitor. Fires when spend exceeds the same day last week by more than \$1,000. | `a - timeShift(a, 1, WEEK) > 1000` |
| **Marginal cost per user** | Row `a`: infrastructure cost. Row `b`: active users from an [external usage metric](https://docs.costory.io/setup/usage-metrics). Fires when cost per user exceeds \$2. | `a / b > 2` |

## Share an alert

By default, an alert is only shared with its creator. To share it with the rest of the organization, open the alert and click **Share**.

In the sharing settings you can:

* Search for people or teams and set their access: **Can manage**, **Can view**, or **No access**
* Give **Everyone in the organization** access so the whole team sees the alert
* Copy the **Link to this view**. Only people listed in the sharing settings can open it, and it does not expire

The roles are the same as on dashboards and reports. See [Sharing](https://docs.costory.io/features/sharing.md#who-can-view-or-edit) for what each role allows.

## When an alert fires

Notifications go to Slack, Microsoft Teams, or email. Each message includes a **View in Explorer** link pre-filtered to the alert scope, so you can investigate the cost change without rebuilding filters.

![Slack notification showing a triggered cost alert grouped by service](https://mintcdn.com/costory/-o1PiYy0cwBDL_-a/images/alerts-slack-notification.png?fit=max\&auto=format\&n=-o1PiYy0cwBDL_-a\&q=85\&s=91798bd91f7b30b9b3c5290cc1e31282)

A Slack notification for a 7-day rolling relative change alert grouped by service

From the alerts list, you can delete an alert you no longer need. Deleting removes the alert and its history.

## Frequently Asked Questions

> [accordion] Can Claude create and manage alerts for me?
>
> Yes. Through the [Costory MCP](https://docs.costory.io/features/mcp.md), Claude uses `create_alert`, `preview_alert`, and `list_alerts` with the same fields as the UI. Describe the outcome in plain English and the agent handles the queries, condition, and dedup rule.

> [accordion] How often are alerts evaluated?
>
> Costory evaluates alerts every day, or three times a day depending on your plan. Data is checked with at least a 48-hour delay so billing data from your cloud provider is finalized.

> [accordion] Who can see an alert I create?
>
> Only you, by default. Use **Share** on the alert to give specific people or teams access, or to share it with everyone in the organization. See [Share an alert](#share-an-alert).

> [accordion] Can I set multiple thresholds on one alert?
>
> No. Each alert has one trigger condition. Create separate alerts when you need different thresholds or notification targets.

> [accordion] What happens when I group by a dimension?
>
> Costory evaluates your condition for every value in that dimension. If several groups breach on the same day, you receive one consolidated notification with the largest breaches included.

> [accordion] Can I alert on custom formulas or ratios?
>
> Yes. Add multiple metric rows and write a custom condition, or start from a preset and adjust the compiled formula. Common patterns include Savings Plan coverage ratios and marginal cost per user from [external usage metrics](https://docs.costory.io/setup/usage-metrics).

> [accordion] Which notification channels does Costory support?
>
> Slack, Microsoft Teams, and email. Each notification includes a link to [Explorer](https://docs.costory.io/features/cost-explorer.md) scoped to the alert.

## Next Steps

> [card] [Costory MCP](https://docs.costory.io/features/mcp.md)
>
> Query costs and manage alerts from Claude, Cursor, or VS Code

> [card] [Budgets](https://docs.costory.io/features/budgets.md)
>
> Create monthly budgets and configure budget alerts per line

> [card] [Digest](https://docs.costory.io/features/digest.md)
>
> Auto-triage cost anomalies with AI-generated incident reports

> [card] [Cost Reports](https://docs.costory.io/features/slack-reports.md)
>
> Send recurring cost snapshots to your team's channels

> [card] [Explorer](https://docs.costory.io/features/cost-explorer.md)
>
> Drill into specific cost changes with full context

> [card] [Dimensions](https://docs.costory.io/features/tagging/dimensions.md)
>
> Create team-level and product-level cost groupings for targeted alerts


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