Google Chat for Alert Notifications

The following steps will configure a ThousandEyes custom webhook to send alert notifications to a Google Chat space.

  1. Open Google Chat and select an existing space or, to create a new space under the Spaces section, click the + and Create a Space as shown in the screenshot below.

    If you already have a Google Chat space you want to use to create the webhook, you can skip to step 3 - the Apps & Integrations step.

  2. Give your space a name (this example uses "ThousandEyes Custom Webhook Test") and click Create.

  3. Use the pull down arrow next to the space and click Apps & Integrations.

  4. Click the Manage webhooks button to create the webhook.

  5. Provide a name for the incoming webhook (this example is named ThousandEyes Webhook) and optionally add an avatar (for example, the ThousandEyes logo), then click Save.

    The optional ThousandEyes logo avatar can be found at: https://avatars.githubusercontent.com/u/307302?s=200&v=4

  1. Important: Copy the resulting webhook URL which includes the key and token information. This will be required for step 11 for ThousandEyes to send alert notifications into the Google Chat space.

  2. Click the X to close.

  3. Log in to your ThousandEyes account and navigate to Integrations.

  4. Click + New Integration.

  5. In the side panel that opens, click Custom Webhook.

  6. Fill in the following fields:

  • Name: This is the name that will be assigned to the alert notification.

  • URL: The URL of the Google Chat webhook (the URL you copied in step 6) where the alerts will be sent.

You can break the key and token out in JSON format and add them to the URL query parameters section instead of using the long URL.

  • Body: The instructions for the webhook. Note: The code below is an example only. You can update it to meet your requirements.

    {
          {{#unless alert.timeCleared }}
          "cards": [
          {
             "header": {
                "title": "Thousand Eyes Alert",
                "subtitle": "{{alert.rule.name}}",
             "imageUrl":"https://avatars.githubusercontent.com/u/307302?s=200&v=4"
             },
             "sections": [
             {
                "widgets": [
                {
                      "keyValue": {
                         "topLabel":"{{#each alert.details}}
                                        {{metricsAtStart}}{{#unless @last}}, {{/unless}}
                                        {{/each}}" ,
                         "content": "<h1>{{alert.test.name}}</h1>",
                         "contentMultiline": "false",
                         "bottomLabel":"Severity Level: {{alert.severity.display}}",
                         "icon": "EMAIL"
                      }
                }]
             },
             {
                "widgets": [
                {
                      "buttons": [
                      {
                         "textButton": {
                            "text": "Show This Test",
                            "onClick": {
                                  "openLink": {
                                     "url": "https://app.thousandeyes.com/view/tests/?testId={{alert.test.id}}"
                                  }
                            }
                         }
                      },
                      {
                         "textButton": {
                            "text": "Show All Active Alerts",
                            "onClick": {
                                  "openLink": {
                                     "url": "https://app.thousandeyes.com/alerts/list/active"
                                  }
                            }
                         }
                      }]
                }]
             }]
          }],
          {{/unless}}
    }

    A completed webhook page should look like the below screenshot.

  1. Click Test to verify that the webhook is working. You will receive the message shown below with OK (200) if it is working.

  2. Verify the Google Chat space received the test message. It should look like the below screenshot.

  3. Click Save.

  4. Apply the webhook to your existing alert rules using the resulting Manage Alert Rules side panel.

For more information on configuring webhooks, see Custom Webhooks.

Last updated