> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ilyama.golain.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Alarms in the Console

> Work the alarm board, write and test alarm definitions, and set up silences and inhibitions from the Golain Console.

Alarms in the Console are project-scoped. Open a project, then use **Alarms** in the sidebar:

| Sidebar item | What it shows |
| - | - |
| **Board** | What is firing right now. Acknowledge, shelve, and unshelve alarms here. |
| **Definitions** | The rules that open alarms. Create, edit, test, activate, deactivate, and delete them. |
| **Silences** | Silences and inhibitions that hold notifications back. |

For the concepts behind these screens (kinds, lifecycle, priority), see [Alarms overview](/alarms/overview.md). For a guided walkthrough, see [Your first alarm](/alarms/first-alarm.md).

## Board

The board header reads **Alarms** and links to **Definitions** and **Silences**.

### Summary

Above the list, the board counts the alarms on the current page:

* **open**, **unacknowledged**, and **shelved** totals. The **unacknowledged** count turns red when it is above zero.
* A small donut and legend splitting open alarms by priority: **P1**, **P2**, **P3**, **P4**.

> [!NOTE]
>
> The summary counts the rows loaded on the current page, not the whole project.

### Search and filters

Use **Search alarms, assets or labels** to filter the loaded rows by definition name, key, labels, or asset.

The filter pills toggle on and off. Click an active pill again to clear it.

| Pill | Shows |
| - | - |
| **Unacked** | Alarms nobody has acknowledged yet |
| **Acked** | Alarms someone has acknowledged |
| **Latched** | Alarms whose condition cleared but stay open until acknowledged |
| **Shelved** | Alarms currently shelved |
| **History** | Closed alarms. The summary is hidden and the **Since** column becomes **Opened**. |

### Columns

| Column | What it shows |
| - | - |
| **Pri** | Priority chip: `P1` (**Critical**), `P2` (**High**), `P3` (**Medium**), `P4` (**Low**) |
| **Alarm** | The instance title (built from its labels), the definition name and key, and up to three label chips. Click the title to open the instance. |
| **Condition · Ack** | Condition badge and acknowledgement badge, with a one-line hint underneath |
| **Trigger** | The value that fired the alarm. For an offline-device alarm: `offline > {window}` and how long it has been open. |
| **Since** | How long the alarm has been open, plus a status line such as **Unacked · subscribers notified** |
| *(actions)* | **Shelve** or **Unshelve**, and **Acknowledge** when the alarm needs it |

Rows are sorted **P1 first, then oldest unacknowledged**.

### State badges

Each row shows two independent things: whether the condition is true, and whether someone has acknowledged it.

| Badge | Meaning |
| - | - |
| **Pending** | The condition is true but has not held long enough to fire |
| **Firing** | The condition held; the alarm is active |
| **Latched** | The condition cleared, but the alarm stays open until acknowledged |
| **Resolved** | The condition cleared |
| **Unacked** | Nobody has acknowledged it (outlined in red). Not shown while **Pending**. |
| **Acked** | Acknowledged, followed by the person's name when known |
| **Shelved** | Shelved. Replaces the ack badge until the shelf expires. |

The hint under the badges explains the state, for example **holds until acknowledged** for a latched alarm or **until {time}** for a shelved one.

### Actions

| Button | When it appears | What it does |
| - | - | - |
| **Acknowledge** | The alarm is firing or latched and unacknowledged | Marks it acknowledged |
| **Shelve** | The alarm is open and not shelved | Opens the shelve dialog |
| **Unshelve** | The alarm is shelved | Removes the shelf immediately |

Closed alarms show no actions. The board has no bulk actions; act on one row at a time.

### Refresh

The board refreshes itself every 10 seconds while the tab is in focus. The footer shows **Live · last transition … ago** and when the board last **checked**. Use **Previous** and **Next** to page through 50 alarms at a time.

## Instance detail

Click an alarm title on the board to open its detail page. Use **Alarms** at the top to go back.

### Header

* Priority chip with its label (for example **P1 Critical**), and a link to the definition.
* The instance title.
* The state badges and a headline such as **Firing for 14 min · unacknowledged · subscribers notified 2×**, or **Shelved until …**, or **Closed … ago**.
* **Shelve** / **Unshelve** and **Acknowledge**, following the same rules as the board.

### Condition

| Field | What it shows |
| - | - |
| **Trigger value** (or **Offline for** for offline-device alarms) | The value that fired, and when the alarm was **last evaluated** |
| **Labels** | Every label on the instance. Device and asset IDs are shown by name when the Console can resolve them. |
| **Fires when** | The definition's condition and, for a query-based rule, its SQL. Offline-device rules show a plain sentence instead. |

Below **Fires when**, a timing line summarizes the rule, for example `held 1 min before firing · keeps firing 2 min after · latching`.

### Guidance

| Row | What it shows |
| - | - |
| **Consequence** | What happens if nobody acts, with the safety class chip if set. **Not written down.** if empty. |
| **Response procedure** | The response steps, one per line |
| **Work orders** | Linked work-order IDs, or **None linked.** When the definition creates work orders automatically, a link to the ticketing board appears. See [Ticketing](/ticketing/overview.md). |

### Transition history

**Transition history** lists the instance's milestones, newest first. Each entry shows the time, how long ago, a title, and who acted where known.

| Entry | When it appears |
| - | - |
| **Opened · pending** or **Opened · firing** | When the instance opened, with its trigger value |
| **Pending → firing** | The condition held for the configured duration |
| **Acknowledged** | Someone acknowledged it |
| **Shelved until …** | Someone shelved it, with the reason they gave |
| **Condition cleared · still firing** | The condition cleared, but the alarm is waiting out its keep-firing time |
| **Resolved** or **Condition cleared · latched** | The condition cleared. A latched alarm **Stays open until acknowledged.** |
| **Closed** | The instance closed |

> [!NOTE]
>
> The history is rebuilt from the instance's own timestamps, so each kind of milestone appears once. Repeated reminders show as a count in the headline, not as separate entries.

### Shelve dialog

**Shelve** opens **Shelve this alarm**. Shelving keeps the alarm open but stops reminders and re-evaluation until the shelf expires. It comes back on its own.

| Field | Details |
| - | - |
| **Shelve for** | Presets **30 min**, **1 h**, **4 h**, **End of shift**, or **Custom** (minutes). **End of shift** runs to the next 06:00, 14:00, or 22:00 local time. |
| **Expires** | The time the shelf ends |
| **This alarm allows up to …** | The definition's **Max shelve** limit (24 h by default). Presets longer than the limit are hidden, and a longer custom value blocks the shelve button. |
| **Reason** | Optional. Recorded on the instance with your name and visible to everyone on the board. |

Finish with **Shelve for {duration}**, or with **Acknowledge and shelve** if the alarm is still unacknowledged.

> [!WARNING]
>
> Shelving does not acknowledge. An unacknowledged alarm stays counted as unacknowledged on the board. Use **Acknowledge and shelve** to do both.

## Definitions list

**Definitions** opens **Alarm definitions**. The header has **Guided setup**, **Board**, and **New definition**.

### Search and filters

* **Search by key** filters definitions on the server.
* **Active** (on by default) and **Inactive** pills filter by status. Click the active pill again to show both.

### Columns

| Column | What it shows |
| - | - |
| **Definition** | Priority chip, name (links to the editor), key, and an **INACTIVE** badge when deactivated |
| **Kind · cadence** | `event`, `threshold`, or `staleness`, a `latching` chip if set, and the cadence, for example `every 30s · for 60s`, `offline 20m · checked every minute`, or `on device event` |
| **Scope** | **Project**, **Asset type**, **Single asset**, or **Every device** (offline-device rules), plus `one alarm per {columns}` or `one alarm per rule` |
| **Subscribers** | How many notification subscriptions listen to this alarm and on which channels, or **None** / `nobody is told` |
| **Status** | **Evaluating** (scheduled rules), **Listening** (event rules), or **Deactivated** |
| **Open** | Open instances, summarized as `N unacked`, `N firing`, `N pending`, or `N shelved` |

The list has no inline toggle or delete. Open a definition to activate, deactivate, or delete it (see [Activate, deactivate, and delete](#activate-deactivate-and-delete)).

## Create a definition

**1. Pick a starting point**

Click **New definition**. The **New alarm** dialog offers four starting points:

| Option | Kind | What it sets up |
| - | - | - |
| **A device goes offline** | `staleness` | One alarm per MQTT device the broker has seen disconnected for longer than a window (default 20 min). Resolves when the device reconnects. |
| **Telemetry stops arriving** | `threshold` | One alarm per device when a dataspace receives no rows from it for longer than a window. The Console generates the SQL for you. |
| **A value crosses a limit** | `threshold` | Query a dataspace on a schedule and fire when a row breaks a condition |
| **Start blank** | `event` | Write the SQL and CEL yourself |

Click **Continue** (or double-click an option). Everything is editable afterwards.

**2. Fill in the editor**

Complete the sections described below. The right-hand rail previews how the rule behaves as you type.

**3. Test it**

Click **Test** to run the query and check notifications without saving. See [Test a definition](#test-a-definition).

**4. Save**

Click **Save and start watching**. The definition starts evaluating as soon as you save.

> [!TIP]
>
> Notifications are not set in this dialog. After you save, subscribe a channel to the alarm under Integrations. See [Notifications in the editor](#notifications-in-the-editor).

## Editor fields

The editor heading is **New alarm** or **Edit definition**, with the kind as a chip. The form shows only the fields the chosen kind needs.

### Identity

The card is titled **What to call it** when creating and **Identity** when editing.

| Label | API field | Meaning |
| - | - | - |
| **Name** | `name` | Display name. Required. |
| **Key** | `key` | Unique in the project. Lowercase letters, digits, dots, dashes, and underscores. Generated from the name until you edit it. **Locked** after creation. |
| **Description** *(optional)* | `description` | Free text |
| **Priority** | `priority` | **Critical** (1), **High** (2), **Medium** (3, default), **Low** (4). Drives sort order on the board. |
| **Scope** | `asset_type_id` / `asset_id` | **Whole project**, **Asset type** (enter an **Asset type id**), or **Single asset** (enter an **Asset id**). Not shown for offline-device rules. |

### What to watch

Pick the kind with the **event**, **threshold**, and **staleness** tabs at the top of the card. You can change the kind only while creating.

**Threshold**

| Label | API field | Meaning |
| - | - | - |
| **Dataspace** | `source_dataspace_id` | The dataspace the query reads. Required. Shows the read view name once chosen. |
| **Query** | `query_spec.sql` | SQL against the read view. Return one row per labelset, and bound `event_ts` with a relative window of 24 h or less (for example `WHERE event_ts >= now() - INTERVAL 1 HOUR`). |
| **Fires when** | `condition_cel` | CEL over each row, as `event.<column>`. Example: `event.temp_c > 235.0`. |
| **Resolves when** *(optional)* | `resolve_cel` | Defaults to **Fires when** going false. Set it lower to add a deadband. |
| **One alarm per** | `labels_by` | Columns whose values identify an instance. Leave empty for one alarm per rule. |

With **Telemetry stops arriving**, the card shows a simplified form instead: **Dataspace**, **One alarm per** (the device column), **Fire when quiet for** (minutes), and **When rows return**. The generated SQL appears under **Generated query**. Click **Edit the SQL by hand** to switch to the full threshold form.

See [Kinds and conditions](/alarms/kinds-and-conditions.md) for query and CEL rules.

**Staleness**

| Label | API field | Meaning |
| - | - | - |
| **Fire when offline for** | `staleness_window_seconds` | Entered in minutes, sent in seconds. Each MQTT device the broker has seen disconnected for longer than this opens its own alarm. A device that has never connected counts as offline. |
| **One alarm per** | — | Always `device_id` |
| **When the device reconnects** | `latching` | **Resolve on its own** or **Stay open until acknowledged** |

> [!NOTE]
>
> LoRaWAN and HTTP devices never connect to the broker. Use **Telemetry stops arriving** for those.

**Event**

| Label | API field | Meaning |
| - | - | - |
| **Fires when** | `condition_cel` | CEL over the changed dataspace row, as `event.<field>`. `asset` and `now` are also in scope. Example: `event.estop == true`. |
| **Clears when** *(optional)* | `clear_cel` | Defaults to **Fires when** going false |
| **On delay** | `on_delay_seconds` | Held this long before firing (seconds) |
| **Off delay** | `off_delay_seconds` | Clear this long before resolving (seconds) |
| **Deadband** *(optional)* | `deadband` | Value must fall this far below the limit to clear |
| **After it clears** | `latching` | **Resolve on its own** or **Stay open until acknowledged** |

### Timing

The **Timing** card is hidden in the simplified **Telemetry stops arriving** form.

| Label | API field | Kinds | Meaning |
| - | - | - | - |
| **Evaluate every** | `eval_interval_seconds` | threshold | How often the query runs (seconds, default 60) |
| **Must hold for** | `for_seconds` | threshold | Pending until the condition has held this long |
| **Keep firing for** | `keep_firing_for_seconds` | threshold | After the condition clears, before it resolves |
| **Re-alarm after** | `re_alarm_delay_seconds` | all | A resolved alarm won't re-open sooner than this (default 300 s). Stops flapping. |
| **Re-notify every** | `repeat_interval_seconds` | all | Remind subscribers at this interval while unacknowledged. `0` sends once. |
| **When a labelset stops producing rows** | `on_no_data` | threshold | **Keep firing** (`keep_firing`), **Resolve** (`resolve`), or **Fire** (`alert`) |
| **After it clears** | `latching` | threshold | **Resolve on its own** or **Stay open until acknowledged** |

For offline-device rules, the card explains that devices are checked every minute against the broker's connection state.

### Operator guidance

Titled **What the operator should do** when creating and **Operator guidance** when editing. All fields are optional and shown on every instance.

| Label | API field | Meaning |
| - | - | - |
| **Consequence** | `consequence` | What happens if nobody acts |
| **Response** | `response_procedure` | One step per line |
| **Safety class** | `safety_classification` | **None**, `process`, `safety`, `environmental`, or `quality` |
| **Max shelve** | `shelve_max_hours` | How long one shelf may last, in hours (default 24) |

### Work order on activation

Turn the **On** / **Off** switch on to raise a work order the moment an instance fires.

| Label | API field | Meaning |
| - | - | - |
| *(switch)* | `auto_create_wo` | Create a work order when an instance fires |
| **Workflow** | `wo_workflow_def_id` | The ticket workflow the work order opens in |
| **Dedup key** *(optional)* | `wo_dedup_key_cel` | CEL. The same key inside the cooldown reuses the open work order. See [Automatic work orders](/alarms/notifications.md#automatic-work-orders) for the variables it can read. |

See [Notifications](/alarms/notifications.md) for how work orders relate to alarm events.

## Preview rail

The right-hand rail updates as you edit.

### If this were on right now

Shown for threshold rules once you pick a dataspace and bound the query. The Console runs the draft SQL and shows how many rows come back, with the first few listed:

* In the simplified **Telemetry stops arriving** form, the count reads **devices would fire**, with how long each has been quiet.
* For a hand-written threshold rule, it reads **rows to evaluate**. The condition itself is not run here, so the count is the rows the condition will be checked against.

Until the query is ready, the card reads **Pick a dataspace and bound the query to see what it returns today.**

### How it behaves

A short step-by-step sketch of what the rule does to one spike, built from your timing settings. For example: pending for the hold time, then fires, then reminders (or **Subscribers are told once; nobody is reminded.**), then resolve or latch, then the re-alarm delay.

## Test a definition

Click **Test** in the editor header. The test dialog, titled **Test “{name}”**, runs checks without saving anything and without opening an alarm. Close it with **Close**.

| Section | Shown for | What you see |
| - | - | - |
| **Query** | Rules with SQL | Runs the SQL and shows up to 20 rows. Badges: **not bounded**, **running…**, **failed**, or the row count. Use **Run** / **Run again** to repeat. |
| **Condition** | Threshold rules | See the note below |
| **Devices that would fire** | Offline-device rules | MQTT devices offline longer than the window, as `{n} of {total} MQTT devices`, each marked **never connected** or **offline {duration}** |
| **Condition** | Event rules | Explains that event rules fire from device events and can't be dry-run. Send a matching event from a device and watch the board. |
| **Notifications** | All | Subscriptions that listen to this alarm, with **Send test** per subscription |

> [!WARNING]
>
> The condition dry-run is not available on the platform yet. For threshold rules, the **Condition** section shows a **not available** badge and the message "This platform cannot dry-run the condition yet". Use the **Query** section to see the rows the condition will be checked against, then save the rule and watch the board.

### Test notifications

The **Notifications** section works only for a saved definition. Before you save, it reads **Save the rule first — subscriptions target a saved definition.**

For a saved definition:

1. Find the subscription in the list. Each row shows the channel (for example `Slack`, `email`, `SMS`), the destination, whether it covers **every alarm** or **this alarm**, and how many events it subscribes to.
2. Click **Send test**. The Console sends a test message through the channel and shows **delivered**, or the provider's error.
3. Click **Send again** to repeat.

Disabled subscriptions can't be tested. A test is a generic message, not an alarm payload: it proves the route, not the template. The platform waits up to 10 s for the provider's answer.

Use **Add a subscription** to create one under Integrations.

## Notifications in the editor

The editor's **Notifications** card is read-only. Who gets told, and where, is set up under Integrations; the definition only decides when it fires.

* While creating, it reads **Nobody is subscribed yet. It will still show on the alarm board.**
* When editing, it lists the subscriptions that listen to this alarm, for example `2 subscriptions listen to this alarm — Slack #ops, email oncall@example.com.` A subscription counts if it is enabled for alarm events and either targets this definition or targets every alarm.
* **Open Notifications** (shown when editing) opens the notification settings under Integrations for this definition.

See [Notifications](/alarms/notifications.md) for subscriptions, re-notify, and escalation.

## Activate, deactivate, and delete

Open a definition from the list. The editor header has:

| Button | What it does |
| - | - |
| **Save definition** | Saves changes. They apply on the next evaluation tick; open instances keep their state. |
| **Deactivate** / **Activate** | Stops or resumes evaluation. Activating also clears an automatic deactivation caused by slow queries. |
| **Delete** | Asks **Delete this definition?** Confirm with **Delete definition**. The rule stops evaluating. |
| **Test** | Opens the test dialog |

## Silences

**Silences** opens **Silences and inhibitions**. Both hold notifications back; the alarms stay open and still show on the board. The header has **Board**, **New inhibition**, and **New silence**.

### Silences list

Each silence shows its matchers, **Window**, **Reason** (with creator and `approved by …` or `not yet approved`), and **State**:

| State | Meaning |
| - | - |
| **Silencing** | Enabled and inside its window |
| **Scheduled** | Enabled; the window has not started |
| **Expired** | The window has ended |
| **Disabled** | Turned off |

Each row has **Edit**, **Disable** / **Enable**, and **Delete**. Deleting asks for confirmation; notifications it was holding back resume on the next evaluation.

### Create a silence

**1. Open the form**

Click **New silence**.

**2. Add matchers**

Under **Matchers**, enter a label name, an operator, and a value. Click **Add matcher** for more. All matchers must match.

**3. Set the window**

Set **Starts** and **Ends**. The defaults are now and four hours from now. The window must end after it starts.

**4. Give a reason**

Enter a **Reason** (required). Optionally fill **Approved by**.

**5. Save**

Click **Create silence**.

### Matchers

| Operator | Matches when the label value… |
| - | - |
| `=` | equals the value |
| `!=` | does not equal the value |
| `=~` | matches the regular expression (fully anchored) |
| `!~` | does not match the regular expression (fully anchored) |

Matchers compare against the instance's **labels** — the `labels_by` columns of a threshold rule, or `device_id` for an offline-device rule. The label name field also suggests names such as `alarm`, `priority`, and `kind`, but instances do not carry those labels, so a matcher on them never matches. Open an instance and check its **Labels** before you write a matcher. A missing label counts as empty: `site=""` matches alarms with no site, and `site!=pune-2` matches them too.

### Inhibitions

An inhibition mutes target alarms while a source alarm fires. Each inhibition shows **While** (source matchers and reason), **Mute** (target matchers), **When these match** (equal labels, or **any**), and **Armed** or **Disabled**. Rows have the same **Edit**, **Disable** / **Enable**, and **Delete** actions.

To create one, click **New inhibition** and fill in:

| Field | Details |
| - | - |
| **While a source fires** | Matchers for the source alarm. Required. |
| **Mute targets** | Matchers for the alarms to mute. Required. The form pre-fills `kind=staleness`; replace it with labels your instances actually carry. |
| **When these labels match** | Comma-separated labels that must be equal on source and target, for example `gateway_id, site`. Empty means any source mutes any target. |
| **Reason** *(optional)* | Free text |

Click **Create inhibition**.

See [Silences and shelving](/alarms/silences-and-shelving.md) for how silences, inhibitions, and shelving differ.

## Next steps

> **[Kinds and conditions](/alarms/kinds-and-conditions.md)**
>
> Write SQL queries and CEL conditions for each kind.

> **[Notifications](/alarms/notifications.md)**
>
> Subscribe channels to alarm events.

> **[API reference](/alarms/api-reference.md)**
>
> Do everything on this page over HTTP.

> **[Troubleshooting](/alarms/troubleshooting.md)**
>
> Fix alarms that don't fire, resolve, or notify.


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