> For the complete documentation index, see [llms.txt](https://docs.ilert.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ilert.com/integrations/inbound-integrations/dbmarlin.md).

# DBmarlin Integration

Create alerts in ilert from DBmarlin alert rules — with ilert's DBmarlin inbound integration.

[DBmarlin](https://www.dbmarlin.com/) is a database observability and performance monitoring tool that tracks database instances, hosts, and the changes that affect them. Its alert rules watch statistics such as query time, executions, or host CPU and fire when a threshold is breached. With this integration, DBmarlin alert rules automatically create alerts in ilert, so the right responders are notified and escalations happen reliably.

## In ilert: Create a DBmarlin alert source <a href="#create-alert-source" id="create-alert-source"></a>

1. Go to **Alerting** → **Alert sources** and click **Create new alert source**.
2. Search for **DBmarlin**, click its tile, and click **Next**.
3. Give your alert source a name, optionally assign teams, and click **Next**.
4. Choose who gets notified: select **Use existing escalation policy** and pick a policy, or **Generate new escalation policy** to start with a basic one that notifies you first. Click **Next**.

   <figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2Fgit-blob-8a281bf3931f5a1a531951ce97984d50989dd875%2Falert-source-escalation-step.png?alt=media" alt="The escalation step of the ilert alert source wizard, headed Who should be notified about alerts, with an escalation policy selected and a preview of its escalation rules below."><figcaption><p>Pick an existing escalation policy, or generate a basic one without leaving the wizard.</p></figcaption></figure>
5. Select **Default grouping** and click **Continue setup**. It groups events by the alert key the integration sets; the other [grouping options](/alerting/configure-alerting/alert-sources.md#event-grouping) are easier to judge once events are arriving.
6. The next page shows more settings, such as notification priority and alert templates. Click **Finish setup** for now; you can change them later.
7. On the final page, ilert generates a webhook URL for your alert source in the form `https://api.ilert.com/api/v1/events/dbmarlin/<api-key>`. Copy it — you will need it in the next section. You can find it again later under the alert source's **Settings** tab.

## In DBmarlin: Enable the Webhook integration <a href="#enable-webhook" id="enable-webhook"></a>

1. In the DBmarlin sidebar, go to **Settings** --> **Integrations**.

   <figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2Fgit-blob-fee365960579a5829eb13c72da259b181f0b1c79%2Fdbmarlin-1.png?alt=media" alt="The Integrations item in the DBmarlin settings sidebar"><figcaption></figcaption></figure>
2. In the **Alert notification** section, find the **Webhook** row and click on **Edit**.

   <figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2Fgit-blob-90675404bdceb152e2c8aa5dbc2ce7283d518297%2Fdbmarlin-2.png?alt=media" alt="The Webhook row in the DBmarlin Alert notification integrations list"><figcaption></figcaption></figure>
3. Click on **Create** to add a new webhook integration.

   <figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2Fgit-blob-88a14cc6dc971a780ce1127970b71a43a8422e21%2Fdbmarlin-3.png?alt=media" alt="The Create button on the DBmarlin Webhooks page"><figcaption></figcaption></figure>

## In DBmarlin: Create the ilert webhook <a href="#create-webhook" id="create-webhook"></a>

Fill in the **Create Webhook Integration** form:

* **Name**: a name for the webhook, for example `ilert webhook`
* **Webhook URL**: the webhook URL you copied from your ilert alert source
* **DBmarlin URL**: the base URL of your DBmarlin installation, for example `http://localhost:9090`. DBmarlin uses it to build the deep link that is sent to ilert as `dbmarlinUrl`, so responders can jump straight from the ilert alert into DBmarlin.
* **Headers**: click on **Add Header** and add `Content-Type` with the value `application/json`
* **Content Template**: the payload for database instance alert rules — copy and paste the template from [Content template](#content-template) below
* **Host Content Template**: the payload for host alert rules — copy and paste the template from [Host content template](#host-content-template) below

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2Fgit-blob-4f6acf6111da11175b30f35c7279170e4fc1cf41%2Fdbmarlin-4.png?alt=media" alt="The Create Webhook Integration form in DBmarlin"><figcaption></figcaption></figure>

Then save the webhook and make sure both the webhook itself and the **Webhook** integration on the **Integrations** page are toggled to **Enabled**.

Finally, attach the webhook to your alert rules: mark it as **Default** so every alert rule uses it, or select it on individual rules under **Settings** --> **Alert Rules**.

### Content template <a href="#content-template" id="content-template"></a>

Used for alert rules on database instances. The `datasourceName` field carries the name of the monitored instance.

```json
{
  "body": {
    "datasourceName": "<datasourcename>",
    "hostname": "<hostname>",
    "severity": "3",
    "summary": "<rulename>: <statistic>",
    "ruleId": "<ruleid>",
    "ruleName": "<rulename>",
    "statistic": "<statistic>",
    "oldValue": "<oldvalue>",
    "newValue": "<newvalue>",
    "threshold": "<threshold>",
    "units": "<units>",
    "from": "<from>",
    "to": "<to>",
    "timezone": "<tz>",
    "dbmarlinUrl": "<url>",
    "interval": "<interval>"
  }
}
```

### Host content template <a href="#host-content-template" id="host-content-template"></a>

Used for alert rules on hosts. Instead of `datasourceName` it carries `eventType`, which DBmarlin populates with the substitution variable `<startedended>` — that is, whether the alert condition started or ended.

```json
{
  "body": {
    "eventType": "<startedended>",
    "hostname": "<hostname>",
    "severity": "3",
    "summary": "<rulename>: <statistic>",
    "ruleId": "<ruleid>",
    "ruleName": "<rulename>",
    "statistic": "<statistic>",
    "oldValue": "<oldvalue>",
    "newValue": "<newvalue>",
    "threshold": "<threshold>",
    "units": "<units>",
    "from": "<from>",
    "to": "<to>",
    "timezone": "<tz>",
    "dbmarlinUrl": "<url>",
    "interval": "<interval>"
  }
}
```

{% hint style="info" %}
Both templates use DBmarlin substitution variables such as `<datasourcename>`, `<rulename>`, or `<statistic>`, which DBmarlin replaces at send time. You can adapt them freely — for example set a different `severity`, change the `summary`, or add your own fields. Extra fields show up as custom details on the ilert alert.
{% endhint %}

When an alert rule fires, DBmarlin renders the matching template and posts it to ilert, which creates an alert.

## FAQ <a href="#faq" id="faq"></a>

#### **Will alerts in ilert be resolved automatically?**

Yes, for alert rules that send the `eventType` field: ilert resolves the corresponding alert as soon as DBmarlin sends the event with `eventType` set to `ended`. This field is part of the host content template. If you also want database instance alerts to resolve automatically, add `"eventType": "<startedended>",` to the content template.

#### **The ilert alert does not link back to DBmarlin. What is wrong?**

Check the **DBmarlin URL** field of the webhook. It must be a URL that your responders can actually reach — `http://localhost:9090` only works on the DBmarlin host itself, so use the externally reachable hostname of your DBmarlin installation instead.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.ilert.com/integrations/inbound-integrations/dbmarlin.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
