# Integrate Spike with Elastic Cloud

<figure><img src="/files/0efG8KayLYhfW9OPu5dh" alt=""><figcaption></figcaption></figure>

### Overview

[Elastic Cloud](https://cloud.elastic.co) provides powerful monitoring and alerting capabilities for Elasticsearch clusters and other monitoring services. It allows teams to maintain the health and performance of their search, analytics, and server operations by detecting issues like slow queries, node failures, or resource exhaustion in real-time.

### Incident alerts from Elastic Cloud

With the Spike integration, you can receive real-time alerts for various incidents detected by Elastic Cloud. These include:

* Cluster health issues
* Node failures
* Resource exhaustion (CPU, memory, disk)
* Slow query performance
* And much more

{% hint style="info" %}
This integration automatically detects and sets Critical severity. It also auto-resolves relevant incidents if configured on Elastic Cloud.
{% endhint %}

***

## Set up instructions

**Step 1:** Create an Elastic Cloud integration on [Spike dashboard](https://app.spike.sh/integrations) and Copy the webhook URL for your integrartion.

{% content-ref url="/pages/-Ln3rb4wLUFeI-OAPcmq" %}
[Create integration and service on our dashboard](/integrations-guideline/create-integration-and-service-on-dashboard.md)
{% endcontent-ref %}

**Step 2:**

{% tabs %}
{% tab title="Setup on Airbrake.io" %}

* **Navigate to alerts**:
  * Go to the Observability section, then select **Alerts and Actions**.
* **Create or modify rule**:
  * Either create a new alert or modify an existing one to define the conditions under which the alert should trigger.
* **Add a Webhook Action**:
  * In the **"Actions"** section of the alert setup, choose Webhook as the action type.
  * Paste the Spike integration webhook URL into the URL field.
  * Adjust the JSON payload to include relevant data for Spike.sh. *Refer to next section for possible payload*
  * `Important` - In the headers, set the `Content-Type` to `application/json`.
  * Save the integration.
    {% endtab %}
    {% endtabs %}

### Payloads

Using Elastic Cloud's available variables, we have formed some template payloads you can use.

{% tabs %}
{% tab title="Cloud monitoring" %}

```
{
	"alert": {
		"actionGroup": "{{alert.actionGroup}}", 
		"actionGroupName": "{{alert.actionGroupName}}",
		"actionSubgroup": "{{alert.actionSubgroup}}",
		"id": "{{alert.id}}"
	},
	"context": {
		"anomalyExplorerUrl": "{{{context.anomalyExplorerUrl}}}",
		"isInterim": "{{context.isInterim}}",
		"jobIds": "{{context.jobIds}}",
		"message": "{{context.message}}",
		"score": "{{context.score}}",
		"timestamp": "{{context.timestamp}}"
	},
	"rule": {
		"id": "{{rule.id}}",
		"name": "{{rule.name}}",
		"tags": "{{rule.tags}}",
		"type": "{{rule.type}}"
	}
}

```

{% endtab %}

{% tab title="Kibana" %}

```
{
	"kibanaBaseUrl": "{{kibanaBaseUrl}}",
	"alert": {
		"actionGroup": "{{alert.actionGroup}}",
		"actionGroupName": "{{alert.actionGroupName}}",
		"actionSubgroup": "{{alert.actionSubgroup}}",
		"id": "{{alert.id}}"
	},
	"context": {
		"anomalyExplorerUrl": "{{{context.anomalyExplorerUrl}}}",
		"isInterim": "{{context.isInterim}}",
		"jobIds": "{{context.jobIds}}",
		"message": "{{context.message}}",
		"score": "{{context.score}}",
		"timestamp": "{{context.timestamp}}"
	},
	"rule": {
		"id": "{{rule.id}}",
		"name": "{{rule.name}}",
		"tags": "{{rule.tags}}",
		"type": "{{rule.type}}"
	}
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: 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:

```
GET https://docs.spike.sh/integrations-guideline/integrate-spike-with-elastic-cloud.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
