# Stackdriver

[<mark style="color:blue;">Stackdriver</mark>](https://cloud.google.com/monitoring/docs) offers monitoring of a wide variety of metrics, dashboards, alerting, log management, reporting, and tracing capabilities.

Route detailed events from Stackdriver to the right users in Squadcast.

### How to integrate Stackdriver with Squadcast

#### In Squadcast: Using Stackdriver as an Alert Source

1. Navigate to **Services** -> **Service Overview** -> select or search for your Service. Expand the accordion -> In the Alert Sources section, click **Add**.

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-4fbd74e7ca0b30173c47a1d58ed6a0804a0465aa%2FAlert_Sources.png?alt=media\&token=aaca6610-9d18-4dd4-9cf5-320042f326f1)

2\. Select **Stackdriver.** Copy the displayed **Webhook URL** to [configure](#in-stackdriver-adding-a-webhook-for-squadcast) it within **Stackdriver.** Finish by clicking **Add Alert Source** -> **Done.**

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-c160915e19ad73ed863153667bfac42abaf0fb51%2FStackdriver.png?alt=media)

{% hint style="warning" %}
**Important:**

When an alert source turns Active, it’ll show up under Configured Alert Sources, you can either generate a test alert from the integration or wait for a real-time alert to be generated by the Alert Source. An Alert Source is active if there is a recorded incident via that Alert Source for the Service.
{% endhint %}

### In Stackdriver: Adding a Webhook for Squadcast

Login to your Google Cloud console. From the sidebar on the left, scroll to find **Operations** and select **Monitoring**

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-d318d86e451af1c431fb3d599b1553fd569be4c9%2Fstackdriver_1_new.png?alt=media\&token=ec319518-0f5a-415e-9d3f-bc788c6a3766)

#### Adding a Notification Channel - Webhooks

**(1)** From the left sidebar, select **Alerting**

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-b0fb53f19d3561dad2800f67458b317ab4dfd529%2Fstackdriver_2_new.png?alt=media\&token=50d65347-4e1d-4ce0-9bc8-adfd58d3381d)

**(2)** Select **Edit Notification Channels**

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-0f01e8ba29f29bdec31ca2080cb2c21f8368e7d4%2Fstackdriver_3_new.png?alt=media)

**(3)** Scroll until you find **Webhooks**. Here, click on **Add New** to add the Squadcast Webhook

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-5624d7b4a30e5cd693e488a2ee5c2527ed0ca2c5%2Fstackdriver_4_new.png?alt=media)

**(4)** Here, paste the previously copied Webhook from Squadcast under **Endpoint URL**. Give the Webhook a meaningful **Displaye Name**.

**Things to keep in mind here**:

* **Do not enable** the checkbox for using HTTP Basic Auth
* When you paste the Webhook from Squadcast in **Endpoint URL** field, ensure you remove the additional `https://` that gets added

**(5)** Click on **Test Connection** and check to see if an incident has been created for the incident in Squadcast

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-42b4fb71f9ac746a770e3025a216435fcb4c5615%2Fstackdriver_5_new.png?alt=media)

**(6)** Finally, click on **Save**

#### Setting up Alerting Policies

**(1)** Within the **Alerting** page, to add a **Policy**, click on either **+ Create Policy** on the top or **Add Policy** in the bottom

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-5ebc322a8ef8d65a7400a08144bb573b220563c9%2Fstackdriver_8_new.png?alt=media\&token=4aec75b3-02f4-42d6-a3ff-051fabbdbd63)

**(2)** Now, **Add Condition** for your **Policy**. In that page, you can set up the metrics that you would wish to monitor and their thresholds, along with the resources

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-e25059c5cd1437d120a158761372451d95b78f9f%2Fstackdriver_9_new.png?alt=media)

**(3)** Once that is done, select **Next**

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-eb14a8d18158e34c1f7f8a93016febd27bd839fb%2Fstackdriver_10_new.png?alt=media\&token=1e5fd30e-2fb8-4aeb-a43e-29c60c565338)

**(4)** In the **Notification Channels** dropdown, select the Webhook previously configured for Squadcast and select **OK**

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-0eb6178b9e57a29c162cdf9271b96a6a3dcbb13a%2Fstackdriver_11_new.png?alt=media)

**(5)** Enable the checkbox as shown in the screenshot to receive **Incident Resolutions signals** as well. Then, select **Next**

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-2db58e806f1cc4751b53bb20f6800e9c5050bcd4%2Fstackdriver_12_new.png?alt=media)

**(6)** Here, add a meaningul **Alert Name**, add **Optional Documentation** and click on **Save** to create your **Alerting Policy**

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-d8fdae11be0faca2692e4f4786dc00c3ae2d8479%2Fstackdriver_13_new.png?alt=media\&token=654241fa-a5cb-4160-849f-3e4dba2b8ead)

**(7)** Once everything is done, in the **Policies** page, you will be able to see the previously added **Alerting Policy**. Ensure that the **Alerting Policy** toggle is **Enabled** to `on`

![](https://1574591692-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F8TaWz01jmUJl58p4ZVel%2Fuploads%2Fgit-blob-b60a66299ab5e0fb8c5b86a340f4a68d437cbeed%2Fstackdriver_14_new.png?alt=media)

That is it, you are now good to go! Whenever an alert is generated in Stackdriver, an incident will be created for the same in Squadcast.

{% hint style="info" %}
**FAQ:**

Q: Does this integration support auto-resolution of incidents in Squadcast?\
A: Yes, this integration **supports auto-resolution of incidents in Squadcast**, meaning that whenever alerts get resolved in Stackdriver, the corresponding incidents will be automatically resolved in Squadcast as well. If you do not enable the checkbox to **recieve Incident Resolution signals**, then your Squadcast incidents will not be auto-resolved when alerts in Stackdriver are resolved.
{% endhint %}

*Have any questions?* [*Ask the community*](https://community.squadcast.com/view/home)*.*
