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

# Redash alert integration

> Send alert state changes from Redash to Flashduty On-call through the Webhook alert destination.

Use the Webhook alert destination of Redash to send query alert state changes to Flashduty On-call. Each Redash alert maps to one Flashduty alert: it triggers when the query result meets the condition (`TRIGGERED`) and recovers automatically when it returns to normal (`OK`). This applies to self-hosted Redash.

<div className="hide">
  ## In Flashduty On-call

  ***

  You can obtain an integration push URL in either of the following ways.

  ### Use a dedicated integration

  1. In the Flashduty console, select **Channel** and open a channel
  2. Select **Configuration** → **Integrations** → **Private integration**, then click **Add an integration**
  3. Select **Redash**, then click **Save**
  4. Open the generated integration card and copy the **Push URL**

  ### Use a shared integration

  1. In the Flashduty console, select **Integration Center → Alert Events**
  2. Select **Redash** and enter an integration name
  3. Configure the default route and select a channel; after creation, add more rules under **Route** if needed
  4. Click **Save** and copy the generated **Push URL**
</div>

## Configure Redash

***

You need Redash administrator privileges to create an alert destination, and the Redash server must be able to reach the Flashduty push URL.

<Steps>
  <Step title="Create a Webhook alert destination">
    1. In Redash, sign in as an administrator, open **Settings → Alert Destinations**, and click **New Alert Destination**
    2. Select **Webhook** as the **Type** and enter a name
    3. Paste the full Flashduty push URL into **URL**. The URL must include `integration_key`
    4. Leave **Username** and **Password** empty. Flashduty authenticates the request by the `integration_key` in the URL
    5. Click **Create**
  </Step>

  <Step title="Add the destination to an alert">
    1. Open the alert you want to connect under **Alerts**, or create one: choose a published query without parameters, then set the **Value column**, condition, and threshold
    2. Under **Destinations**, click **Add** and select the Webhook destination you just created. Redash sends no notification until a destination is added
    3. Set **Send notification** to **Each time alert is evaluated** or **At most every ...** to repeat notifications for an alert that stays triggered; **Just once** notifies only when the alert triggers. Repeated notifications update the same Flashduty alert instead of creating a new one
    4. Optional: under **Notification template**, choose **Custom template** and fill in the Subject and Body. The subject becomes the Flashduty alert title and the body becomes the description; when left empty, the title is the Redash alert name and the description is the trigger condition
    5. Save the alert
  </Step>

  <Step title="Verify">
    1. Make the query result meet the alert condition, wait for the query to run on its refresh schedule, and confirm Flashduty receives an active alert
    2. Make the query result return to normal and confirm the alert recovers

    The Redash Webhook destination has no test button.
  </Step>
</Steps>

## Alert Key

***

Flashduty uses the Redash alert ID (`alert.id`) as the Alert Key. The trigger, repeated notifications, and recovery of one Redash alert share one Alert Key. Changes to the alert name, condition, threshold, or state do not change it. A request without `alert.id` is rejected.

Connect only one Redash instance to each Flashduty integration: alert IDs repeat across instances, so create a separate integration for each.

## State and severity

***

Redash notifications carry no severity, so Flashduty acts on the alert state:

| Redash state | Flashduty action | Severity |
| :- | :- | :- |
| `triggered` | Trigger or update the alert | Warning |
| `ok` | Recover the alert | - |
| `unknown` | Ignored; the request returns success | - |

`unknown` means the query has no data to evaluate. Redash notifies only when the state changes, or when a triggered alert passes its repeat interval; an alert whose first evaluation is `OK` sends no notification.

## Labels

***

| Label | Source |
| :- | :- |
| `check` / `alert_name` | Redash alert name |
| `alert_id` | Redash alert ID |
| `query_id` / `user_id` | ID of the alert's query and of the user who created the alert |
| `state` | Alert state |
| `column` / `condition` / `threshold` / `selector` | The value column, comparison operator, threshold, and selector set on the alert |
| `alert_url` / `query_url` | Links to the alert and the query in Redash |

## Troubleshooting

***

* **Flashduty receives no alert**: confirm the alert has the Webhook destination, is not muted, and its query is published and runs on a refresh schedule. Redash times the request out after 5 seconds and does not retry; failures appear only in the Redash log
* **Flashduty returns an invalid-parameter error**: confirm the URL is complete and includes `integration_key`
* **The alert does not recover**: Redash sends the recovery only when the state becomes `OK`; while the query has no data the state is `unknown` and the alert stays open
* **No repeated notifications**: **Send notification** is set to **Just once**

For more details, see the [Redash alerts documentation](https://redash.io/help/user-guide/alerts/setting-up-an-alert).
