Receiving Stackdriver Alerts

Here's how to set up a webhook to receive Stackdriver alerts.

Once configured, you can:

  • route Stackdriver alerts to Transposit and Slack
  • create activities and run runbooks tied to Stackdriver alerts
  • trigger runbooks to run when Stackdriver alerts are received
  • trigger runbooks to run when the payload's content matches your conditions
  • trigger runbooks to run when an activity is created in response to Stackdriver alerts
  • invoke actions to remediate the underlying issues triggered by Stackdriver
  • set dynamic parameters using payloads provided by Stackdriver alerts

Follow the steps below to integrate Stackdriver alerts with Transposit.

1. Create Stackdriver Alert Webhooks in Transposit#

Go to Settings > Webhooks, and click Add webhook. Choose Stackdriver alerts, as shown below.

Note: The optional Slack channel must already exist, create it before adding the webhook.

Click Add and then find the webhook you just added in the list. Click Click to copy to copy the URL to the clipboard or manually copy the endpoint URL.

2. Define Webhooks in Stackdriver#

Follow the "Managing Notification Channels" section of the Stackdriver documenrtation and create a webhook, as shown below.

3. Trigger Alerts in Stackdriver#

When you test the connection by clicking Test Connection, shown above, or when you create Stackdriver alerts, you should see events appearing in Transposit's Webhook events page, shown below, and, optionally, in Slack.

4. Integrate Stackdriver Alerts in Transposit#

With Stackdriver alert webhooks set up, you can do the following in Transposit.

4.1 Receive Alerts#

When a Stackdriver alert is triggered, you should see alerts displayed as events in Transposit, as shown below.

In Slack, if you defined the webhook in Transposit to support Slack, you should see Stackdriver alerts displayed, too, as shown below.

4.2 Create Activities#

When an alert is received in Transposit or Slack via the Stackdriver alert webhook, click the Create activity button to create a new activity, add runbooks, and follow the progress of work done by your team in response to Stackdriver alerts.

4.3 Trigger Runbooks#

If you have added runbook triggers based on Stackdriver alerts, your runbooks will start automatically when a Stackdriver alert is received, as shown below.

Alternatively, using the Conditions button, and choosing Custom output parameters, you can specify that your runbooks will start automatically when a Stackdriver alert is received with specific data in its payload, as shown below.

For example, you might want a runbook to be triggered based on the state of the incoming alert, as shown below.

Stackdriver customer output parameters you can refer to in your conditions are as shown below.

  • google_monitoring_condition_name
  • google_monitoring_started_at
  • google_monitoring_state
  • google_monitoring_url
  • google_monitoring_incident_id
  • incident

Alternatively, you can specify that the runbook should start only when an activity is created from the webhook, as shown below.

4.4 Add Dynamic Parameters#

If you have defined dynamic Stackdriver alert parameters while adding runbook actions, as shown below, their values will be populated by the Stackdriver alert's payload when the actions are executed during runbook runs.

When you select the items above, parameters are generated, as shown below, between opening and closing double curly braces.

  • Trigger.Webhook.Stackdriver alerts.app_name
  • Trigger.Webhook.Stackdriver alerts.service
  • Trigger.Webhook.Stackdriver alerts.google_monitoring_condition_name
  • Trigger.Webhook.Stackdriver alerts.google_monitoring_started_at
  • Trigger.Webhook.Stackdriver alerts.google_monitoring_state
  • Trigger.Webhook.Stackdriver alerts.google_monitoring_url
  • Trigger.Webhook.Stackdriver alerts.google_monitoring_incident_id
  • Trigger.Webhook.Stackdriver alerts.incident

Next Steps#