Exploring the Google Stackdriver Error Reporting API

” It’s hard enough to find an error in your code when you’re looking for it; it’s even harder when you’ve assumed your code is error-free. ” – Steve McConnel

In previous blog, we have tried to log the front end error’s in GoogleAnalytics, it has supported very good,
but the Google Analytics is not solely meant for error capturing and search started for exploring better error reporting system. Then just discovered about Google Stackdriver.

Google has acquired cloud monitoring service Stackdriver in 2014.

Google Stackdriver provides powerful monitoring, logging, and diagnostics. It equips you with insight into the health, performance, and availability of cloud-powered applications, enabling you to find and fix issues faster. It is natively integrated with Google Cloud Platform, Amazon Web Services, and popular open source packages. Stack driver provides a wide variety of metrics, dashboards, alerting, log management, reporting, and tracing capabilities.
In this blog we are, are going to explore the Google Stackdriver Error Reporting API which is one among the below features,


Google Stackdriver Error Reporting API:

Stackdriver Error Reporting counts, analyzes and aggregates the crashes in your running cloud services. A centralized error management interface displays the results with sorting and filtering capabilities. A dedicated view shows the error details: time chart, occurrences, affected user count, first and last seen dates and a cleaned exception stack trace. Opt-in to receive email and mobile alerts on new errors.

What we are going to do is,

  1. Setup Google Stackdriver account
  2. Setup Error Reporting
  3. Try Stackdriver Error Reporting API via Explorer
  4. Explore the dashboard
  5. Google Cloud Console Mobile application
  6. Stackdriver API Integration possibilities
  7. Pricing
  8. Pros
  9. Cons

1. Setup Google Stackdriver account

This is a simple easy step to create the google stackdriver acccount with gmailId, while creating , right now skip the monitoring configuration, just create the stackdriver account. You will be asked to choose the option “Upgrade” or “Free Plan”, Choosing Upgrade option will prompt for Billing Details so lets skip that right now and Choose free.

2. Setup Error Reporting

These are the simple steps to setup,

  • Setting Up Client-Side JavaScript Error Reporting
  • Select or create a Cloud Platform project.
  • Enable the Stackdriver Error Reporting
  • Generate an API key.

The generated API can be used for posting errors to stackdriver, wheres those errors can be Awesomely viewed on dashboard.

3. Try Stackdriver Error Reporting API via Explorer

You can try the stackdriver error reporting api with this URL Provided by Google.

https://cloud.google.com/error-reporting/reference/rest/v1beta1/projects.events/report

In the API, we can post detailed errors, like API URL, IP, error message, line number, stack trace, etc.,. But there is no way to send custom data to error messages, one possible way to stringy the data and to send it to message.

4. Explore the dashboard

  1. Grouping
    1. The Dashboard has very well grouped the errors for better viewing , auto reload feature for live error loading .
  2. Filtering
    1. Sort by occurrences, number of affected users or first/last seen date.
    2. Filter the content by time window or service.
    3. Enable auto-refresh to keep an eye on the changes.
  3. Alerting and Notification
    1. It has Email alerts, mobile alerts(Cloud Console app) has push notification.
    2. Email settings for error notificaion, cumulative reports.
  4. Linking the Bugs to Bug Tracker
    1. It has a special feature to link the errors to a particular issue id.
  5. Linking with Source controls like (github, bitbucket) code , while clicking the line number on error, it integrate with source code for debugging .

5. Mobile Application for Google Cloud Console:

Google cloud console app is available on play store, it has the dashboard for error reporting, on drill downing the messages we can get more details.

It has push notification , while any error has happened and it can be controlled by notification settings.

6. Integration Possibilities :

After getting the API credentials, the user can send errors from various sources, server, front end websites, mobile application.

Stackdriver Error Reporting API  : https://cloud.google.com/error-reporting/reference/rest/

Also google has developed various client libraries for sending error which is listed below.

Client Libraries : https://cloud.google.com/error-reporting/docs/client-libraries

Github repo for Client-side JavaScript exception reporting library for Stackdriver Error Reporting,

7. Pricing

Stackdriver Error Reporting supports errors sent through the use of either:

8. Pro’s

  1. Great dashboard
  2. Integrating with applications and also with issues tracking .
  3. Alerts and notification.
  4. Cloud Console on Mobile

9. Con’s

  1. Download the error data like exporting the errors.
  2. Couldn’t find a way to send extra information while sending error details, may be they are limiting the error message size, but it will be great if it has this feature.

PS : Right now, this error reporting API is in BETA

This is one of the better solution for Error Reporting service which is in the market.