Welcome to the xMatters community!

We created this site for our customers and partners and we encourage you to explore, engage, and learn. To ensure that this community is fun and helpful, professional and respectful participation is expected... and troll-like behavior won't be tolerated.

GIG: Google Stackdriver: Alerting for virtually stacked drives

We visited Cloudwatch a while back and in all fairness to the"Alexa" and "Hey Google" camps, I thought I should check out Google's Cloud Monitoring arm. Google uses Stackdriver to monitor the containers and VMs running on their cloud. And they can do all the basic monitoring you could imagine from outside a VM. Let's take a look what an integration from Stackdriver's Alerting Policies to xMatters would look like.

We'll use the trusty old Webhook to fire off to xMatters, so login to your Stackdriver Alerting Policies page and we see a complaint there are "No Saved Policies".

Before we create the Policy, we have to create the webhook, so click the project name in the upper left and click Account Settings.

Click Notifications item and the Webhooks tabs.

Click Add Webhook and paste in the Inbound Integration URL from xMatters. (If you don't have it yet, download the Stackdriver Comm Plan below and import into your xMatters instance. We'll be here when you get back.)

If needed, you can add query parameters to the end of this url, like so:

Then, you can parse those in the Integration Builder script with the "request.query" variable. This might be useful if you need to flag one webhook over another.

If you'd like to enable authentication, hit the basic auth checkbox and enter the username and password from the inbound integration endpoint. Hit Save. Now, head back to the Alerting Policies page and hit Add Policy. There are 4 different sections here so I'll go through them each individually.

First, create a Condition on when to fire the alert. I've selected a low CPU threshold for testing.

Hit Save Condition to be brought back to the Alert Policy set up page and click the Add Notification button. This is where we tell Stackdriver to send the info to xMatters. So, select Webhook and the name of the Webhook you just created.

The next section is for additional documentation. Unfortunately this information is not sent via Webhook. :(

Finally, give it a descriptive name and hit Save Policy.

Great! We have an Alerting Policy and in theory it will fire to xMatters. But first, we need to tell it who to fire to. So, open up the Stackdriver Communications Plan and click Layout next to the Stackdriver Incident. Then enter your username in the Recipients field.

So let's test it out. Do something that will trigger the Alert Policy and check out your notification medium of choice for the alert.

Et voila!

In a real life scenario, you might use Subscriptions to figure out who needs to be notified, or you might just select an xMatters group and let all the group members duke it out.