# Cost alerts

> Rules that watch your spend or your commitments and tell the right people, in the dashboard and in Slack, when a line is crossed.

Source: https://docs.levelfour.ai/cost-alerts


A cost alert watches one thing, an account or project, or your commitments, and tells the people named on it when a line you set is crossed. Alerts belong to the organization: everyone sees the same list, and a change to an alert applies to everyone on it.

## Create an alert

### Open Cost alerts

In the dashboard sidebar, click **Settings**, then **Cost Alerts**, then **Create alert**.

### Choose the type and what it watches

Pick one of the types below, then the source: an account or project for **Budget** and **Cost changes**, **AWS commitments** or **Contracts** for **Commitment**.

### Set when it fires

The rule reads as a sentence, and you fill in its numbers. The form prefills none of them, so an alert never fires on a value nobody chose.

### Choose who hears it

Add the members who should get it. Only members of the organization receive alerts.

Then pick the **Slack channels** it posts in, up to 10. A new alert starts with your organization's default channel, if one is set, and you can remove it or add others. The list shows the public channels and the private ones `@levelfour` is in.

**Your Slack DMs** turns on direct messages for you, for every cost alert you receive. **Your email** sends each one to the email address on your account. Both stay off until you turn them on, and both are the same switches as the **Cost alert** row on **Notification preferences**.

## Types

| Type             | Fires when                                                                                                                                                                                                    |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Budget**       | Spend passes a share of a monthly budget, or an amount, at any point in the month or within a number of days of its start or end. One alert can carry several thresholds.                                     |
| **Cost changes** | Spend rises more than an amount you set against the same days last week, the same days last month, or the previous 7 days. A floor keeps a small rise on a small bill quiet.                                  |
| **Commitment**   | A Reserved Instance or Savings Plan is within a number of days of its end, from 1 to 365. On **Contracts**, usage passes a contract's monthly commitment, or is on course to pass it by the end of the month. |
| **Reliability**  | A Kubernetes workload reaches a minimum risk: high, medium or low, as its reliability indicators judge it.                                                                                                    |

### Commitment alerts

A commitment alert judges each commitment on its own. Nine commitments ending across two days are nine warnings, one per commitment, each sent once for that term. A commitment you already renewed stays quiet, and LevelFour skips one that has already ended.

### Contract alerts

The **Contracts** source appears once your organization holds a contract: a Datadog contract LevelFour reads from your bill, a DigitalOcean contract, or a marketplace contract. It sits beside **AWS commitments**, so you can watch a contract with no Reserved Instance or Savings Plan in the account. Under **Warn when**, pick one of two watches:

| Watch                             | Fires when                                                                                                                                                                                                                                  |
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Usage is on course to pass it** | A contract line's month-end projection passes what the line commits to. It fires once a month for each line, before the first on-demand charge. The notification names the line, the projection, the commitment and the day usage passes it |
| **Usage has passed it**           | Usage passes a contract's monthly commitment. The notification gives the metered amount against the commitment                                                                                                                              |

Neither watch takes a threshold: each fires on the comparison itself. The projection reads the lines of a Datadog contract, and [Datadog contract](/connectors/datadog/contract) explains how LevelFour builds and projects them.

### Kubernetes alerts

A budget or cost-changes alert can watch a Kubernetes cluster, one of its namespaces or one workload. On a Kubernetes source it measures either what the containers cost or their **waste**, the part of that cost they held and did not use, both from the cluster's [pricing](/connectors/kubernetes/pricing).

A reliability alert watches every workload in the cluster, namespace or workload you pick, and announces each one on its own when it reaches the minimum risk. You hear about a workload once, until it clears: the alert clears once the workload stays below the minimum for two checks, and a later relapse is announced again. **Ignore rules** keep it quiet about a namespace, a workload (as `Deployment/api`), an indicator such as OOM kills, or any pair of them: each field you fill in has to match.

**Channels per namespace** send each namespace's workloads to its own Slack channels, so the team that owns a namespace hears about its workloads alone. A namespace with no route posts in the alert's channels.

[Kubernetes recommendations](/connectors/kubernetes/recommendations) explains the indicators.

## Where alerts arrive

* **The bell** in the dashboard header, for every recipient.
* **Each Slack channel on the alert**, one post per channel.
* **A Slack direct message**, for each recipient who turned on Slack for cost alerts, on **Settings > Notification preferences** or in an alert's form.
* **An email**, for each recipient who turned on email in the same places.
* **Datadog**, as an event, when **Datadog** is on in the alert and your [Datadog organization is connected](/connectors/datadog). Every event carries the tag `source:levelfour`. A Kubernetes alert's event also carries `kube_cluster_name`, `kube_namespace` and the workload's own tag, such as `kube_deployment`, so Datadog monitors and dashboards can pick it up. Changes the Kubernetes [automation component](/connectors/kubernetes/automation) makes reach Datadog the same way.

[Slack](/integrations/slack) covers the channels, the default channel, direct messages and the **Investigate** button.

## How often alerts are checked

LevelFour checks every alert in every organization about every 15 minutes. A crossing has to hold on two checks in a row before the alert fires, so a figure sitting on the line does not flap. Each crossing is announced once per period, so a budget that stays over its line all month tells you once that month. When a figure comes back under its line, the alert's history records it, and nobody is notified.

## History

Open an alert to see what it has said, newest first: when it fired or cleared, the figure against the line it crossed, the commitment it was about, and whether anyone was told. A firing that reached nobody says so.

## Edit, pause, delete and suggestions

* **Edit** an alert by clicking its name. Every field can change, what it watches included.
* **Pause** an alert with the switch on its row. A paused alert shows who paused it, and it moves to the **Paused** tab.
* **Delete** an alert with the trash icon on its row, or from its form. LevelFour asks first, because the alert's history goes with it. To stop an alert for a while, pause it instead.
* **Suggestions** proposes budgets from an account's own billing history. Turning one on sends it to you.
* **Admins and members** create, change and pause alerts. Viewers see them.

## From the API, the terminal and AI clients

Every change above also works outside the dashboard, with the same rules and permissions:

| Surface                                     | Create                     | Change                           | Pause and resume                      | Delete                            |
| ------------------------------------------- | -------------------------- | -------------------------------- | ------------------------------------- | --------------------------------- |
| [REST API and SDKs](/resources/cost-alerts) | `POST /api/v1/cost-alerts` | `PATCH /api/v1/cost-alerts/{id}` | `PATCH` with `enabled`                | `DELETE /api/v1/cost-alerts/{id}` |
| [CLI](/cli/commands/alerts)                 | `l4 alerts create`         | `l4 alerts update`               | `l4 alerts pause`, `l4 alerts resume` | `l4 alerts delete`                |
| [MCP server](/mcp/tools)                    | `create-cost-alert`        | `update-cost-alert`              | `pause-cost-alert`                    | `delete-cost-alert`               |

A change sends only the fields it names, and a new rule replaces the whole rule, so raising one threshold means sending the rule back with that figure changed. Writes need a read-write API key, or an AI client connected with write access. An AI client deletes an alert only when it names the alert as well as its id, so the alert it deletes is the one it read.

## Next

* [Slack](/integrations/slack) sets up the default channel and direct messages, and explains **Investigate**
* [Notifications](/notifications) covers the bell and your notification preferences
* [Commitments](/commitments) shows every Reserved Instance and Savings Plan an alert watches
* [Datadog contract](/connectors/datadog/contract) projects each contract line to the end of the month
