# Create an Alert from a Chart

These instructions apply to the current Admin Console.

{% hint style="info" %}
Alerts are in early access and may not be available in your account. [Contact Contextual support](mailto:help@contextual.io) to request that Alerts be enabled for your tenant.
{% endhint %}

Create a threshold alert from a supported chart in an agent's **Metrics** tab or from the **AI Gateway** tab under **Operate → Metrics** in the Admin Console. The chart supplies the metric and scope. Review the resulting rule before saving it.

Alerts must be enabled for the tenant. You need `contextual:alert-rules:read` to load the chart metric catalog. Creating the alert also requires rule-create, subscription-create, destination-read, and the metric's source-read permissions. Enabled metrics rules also require [background metrics access](https://docs.contextual.io/operate/alerts/background-metrics-access.md). The bell action appears only for supported metrics and available capabilities; a chart's presence alone does not establish alert support.

## Create a Rule

1. Open the chart's bell action, **Create an alert on …**. If the chart already has alerts, open its alert menu and choose **New alert**, or **New alert on …** for a particular metric.
2. Check **Scope**, **Rule metric**, and any notices. Agent charts scope the rule to that agent. Some metrics cannot preserve a selected pod and instead monitor all its pods; the dialog explains this. The AI Gateway dashboard authors service-scoped rules for `ai-gateway-api`.
3. Set **Name**, **Metric** where offered, **Condition**, and **Threshold**. Enter the threshold in the displayed units: for example, `5` in **Threshold (%)** means 5%, stored as `0.05` in an AI Gateway attempt failure rate rule. When the metric accepts a [failure type](https://docs.contextual.io/operate/alerts/metrics-and-queries.md#alert-on-a-failure-type), such as failed requests, the dialog also offers **Failure type**, to count one type, and **Group by**, where **Failure type** creates one series per type. Leave **Failure type** at **All** to count every type.
4. Review **Evaluation window**, **Sustained for**, and **Severity**. The chart's visible time range helps choose the initial window. Platform metrics offer `5m`, `15m`, and `1h`. AI metrics also offer `24h`. Optionally set **Minimum calls** for attempt failure rate or **Minimum requests** for failed requests or fallback rate. Leave the field blank to evaluate without a sample floor.
5. Choose a **Destination**. Leave **Notify on recovery** checked to receive resolved notifications, or clear it to opt out for this route.
6. Select **Review**. Resolve validation errors and inspect the condition and scope. Agent charts do not provide a historical alert preview. For AI metrics, inspect any returned preview and its limitations; an unavailable preview is not evidence that the condition never occurred. Rules with a `24h` window cannot be previewed, because preview looks back at most 24 hours.
7. Select **Create alert**, then inspect the saved rule and notification route in **Alerts**.

The Admin Console saves the rule before its subscription. If only routing fails, use **Retry notification route** to complete that saved rule's setup. If the outcome is uncertain, inspect **Rules** and **Destinations → Advanced routing** before creating another rule.

Chart values and rule observations can use different aggregation or counter semantics. Read notices about window deltas, totals, or aggregation differences. A threshold line is shown only when its value is comparable to the plotted series; its absence does not mean no rule exists.

AI rules with windows of 24 hours or longer normally evaluate every 15 minutes. If a firing series stays below its sample floor, evaluations omit it. It can become stale once the time since its last observation exceeds the longer of the configured staleness threshold and two evaluation intervals (30 minutes).

See the [AI Gateway attempt failure rate rule](https://docs.contextual.io/tenants/tenant-apis/alerts-api/configuration.md#ai-gateway-attempt-failure-rate-rule) for the full API request body.

## Edit an Existing Chart Alert

Open the chart's alert menu and select a supported rule that matches its scope. Change the condition, select **Review**, and then **Save changes**. Editing requires rule-update and source-read permissions. Validation accepts either rule-create or rule-update permission. If the record changed, reload and review the current configuration before retrying.

A rule covering multiple agents is marked **Multi-agent rule, view in Alerts**. Follow that link to inspect it centrally; the single-agent chart does not offer to rewrite its broader scope. Use the [configuration API](https://docs.contextual.io/tenants/tenant-apis/alerts-api/configuration.md) for rules that this chart editor cannot represent. Manage existing recovery preferences through [Edit notifications](https://docs.contextual.io/operate/alerts/destinations-and-subscriptions.md#change-recovery-notifications).

## Read Chart Status

| Status | Meaning |
| --- | --- |
| **Firing** | The Admin Console found a firing alert for a matching rule. |
| **Watching** | The rule is enabled, its latest evaluation status is OK, and the complete active-alert list contains no matching firing alert. |
| **Unknown** | The Admin Console could not read the complete active-alert list, so it cannot establish that the rule has no firing alerts. |
| **Dark** | The rule is enabled but does not have an OK evaluation status available. Inspect its evaluation details. |
| **Disabled** | The rule is disabled. |

These badges summarize loaded data. They are not proof of delivery or complete alert history. Use **Operate → Alerts** to inspect evaluation, history, and delivery details. For stop, restart, and deletion requests, see [lifecycle notifications](https://docs.contextual.io/operate/alerts/agent-lifecycle-notifications.md).
