Skip to main content
Data Runs Deep Menu

Main navigation

  • Home
  • Who We Are
    • Careers
    • What We're Up To
    • What We Believe In
    • Ethical Policy
  • What We Do
  • Google Marketing Platform
    • Analytics 360
    • Tag Manager 360
    • Salesforce and GA360
    • Google Analytics App+Web
    • Data Studio
    • Optimize
  • Google Cloud Platform
    • Google BigQuery
      • Google BigQuery Training
      • Google Analytics Integration
  • Consulting
    • Strategy
    • Implementation
      • Google Analytics Audit
      • Google Tag Manager Audit
      • Enhanced Ecommerce Implementation
      • Google Tag Manager
    • Analysis
      • Google Data Studio
        • Google Data Studio Case Study - Mona
      • UX Analysis
  • Training
    • Five Day Google Analytics Online Workshop
    • Advanced Google Analytics Training
    • Google Tag Manager Training
    • Google Analytics 360 Training
    • Advanced Analytics Bootcamp
  • Partnerships
    • Conductrics
  • Blog
  • The Flying Beagle
  • Merch
  • Contact

How To Set Up Cloud Function Failure Notifications With Stackdriver

Set Up Cloud Function Failure Notifications With Stackdriver
By: Balkan Misirli
Posted in
  • Google Cloud Platform
  • Google Cloud Functions
  • Stackdriver
Article Date
June 13, 2019

When your Google Cloud Function invocations fail, you want to know about it as soon as possible. There is a built-in monitoring tool in GCP called Stackdriver, which is easily configurable to send out emails whenever this happens. This short guide will show you exactly how to set this up.

Navigate To Stackdriver

  • Go to console.cloud.google.com
  • In the hamburger menu in the top left, scroll down until you find the STACKDRIVER section
  • Click on Monitoring 

This will open up a new window containing the Stackdriver console. If this is the first time you are doing this, it will automatically set up a new Stackdriver workspace for your GCP project.

 

 

Create And Configure New Alert Policy

The page you see will read ‘Welcome to Stackdriver Monitoring!’. In the side panel on the left, click on Alerting > Create a Policy.

 

 

Click the Add Condition button.

 

 

Use the following settings:

  • Title: Give the alerting policy a descriptive name, like ‘Cloud function error notification’
  • Resource type: Cloud Functions
  • Metric: Log entries

 

  • Filter: scroll down to find ‘severity’. In the resulting input box, type ‘ERROR’ in the Value field. This is not given as one of the clickable options in the list of values, so you must explicitly type it in.

 

 

 

  • Configuration: 
    • Condition triggers if: Any time series violates
    • Condition: is above
    • Threshold: 0
    • For: most recent value

 

 

  • Click Save

 

  • Notifications: Email
  • Email address: Enter your email address

 

 

  • Click Add Notification Channel
  • Once you have done this, you will see your email appear in the list below.

 

 

  • It is also a good idea to write a description of why this alert was created and what it does.

 

 

  • Give this alert policy a descriptive name, like ‘Cloud Functions Error Notification’. Each alerting policy is made up of (one or many) policy conditions. Earlier in this process, you gave this alerting policy’s condition a name ('Cloud function error notification'). In this step you are giving the alerting policy a name. For the sake of simplicity, we suggest to use the same name. 

 

 

  • Click Save

You will now be able to see your new alert policy in the list of active policies.

 

 

If you ever want to add or remove people in your alerting policy, you can do this by clicking into your policy and clicking the ‘Edit’ button in the top right. Simply amend the details in the Notifications box as necessary. 

 

 

That’s it! You will now receive emails whenever a cloud function fails, with some details around which function failed and why. The email will look like the below example.

Get in touch

To find out more, email us on hello@datarunsdeep.com.au or complete a quick contact form.

Get in touch

Talk to us: 1300 737 885

08:30 - 16:30, Monday to Friday. We love to chat

Visit us, we’re at:

Level 8, 313 Little Collins Street Melbourne, VIC 3000

Footer

  • Home
    • Who We Are
      • What We Do
      • What We're Up To
      • Careers
      • Contact
  • Training
    • Google Analytics Training Courses
    • Advanced Google Analytics Training
    • Google Tag Manager Training
  • Consulting
    • Analysis
    • Implementation
    • Strategy
    • Google Analytics Audit
    • Google Tag Manager Audit
  • Google Cloud Partner
  • Google Marketing Platform Sales Partner
  • Bitcoin accepted here
  • Registered Looker Consulting Partner Melbourne
  • Twitter
  • LinkedIn
  • Google Plus
  • Blog RSS feed
Copyright © 2009-2021 Data Runs Deep Pty Ltd. All Rights Reserved. Google Analytics is a trademark of Google Inc.
Website by Marin Sekesan