Documentation / Product / Integrations / Google / Google Stackdriver

Google Stackdriver Monitoring

To monitor Lytics, we have an integration that will export a variety of Lytics metrics to a tool of your choice, in this case Google Stackdriver. This allows you to easily set up dashboards, alerts, thresholds inside your existing monitoring tools.

Example of a Stackdriver dashboard we created showing metrics. stackdriver dash

Why

Our customers want to be able to monitor, alert, visualize a variety of important metrics from Lytics. Instead of building alerting into our tool, we decided to allow metrics to be written into your own monitoring tools.

  • Allow alerting, oncall distribution lists, quiet-hours to be managed within a tool where you are already doing that for other metrics.
  • Allow correlation of metrics you have (possibly website performance, etc) to be shown in context of other metrics.
  • Prevent operational users from having to create a Lytics admin user-account.
  • Most monitoring tools have anomaly detection, threshold based alerts, etc that would be features that may be beyond capabilities we could provide natively.

Before You Begin

Ensure you have created a Google Cloud account, and enabled Stackdriver. This tutorial will walk you through creating project, enabling monitoring. You can ignore the section on creating an HTTP server.

Authentication

To use write metrics to Google Stackdriver, you will need a service account with a JWT JSON token.

NOTE: You will need "Editor" writes to your project in order to be able to create custom metrics.

  1. In the Google Cloud console under IAM & Admin select Service Accounts.
  2. Click + Create Service Account
  3. Enter the details for your new service account and click Create. Create service account

  4. From the Role dropdown, select the Monitoring Editor and click Continue to grant these permissions to your account. Select role

  5. Click + Create Key to download the private key you will need for authorization in Lytics. Create JSON key

  6. For the key type select JSON and click Create to download the key as a JSON file. Select key type

  7. In Lytics, navigate to the Google integration in the Integrations section of Lytics. Google Cloud Integration Tile

  8. Select any integration option to begin authorization setup. Google Cloud Select Integration

  9. Click Add new authorization.

  10. Paste the JWT into the JSON Service Account JSON text box.

  11. Add a description for your authorization.

  12. Click Authorize. Google Cloud Authorization

Export Metrics To Stackdriver

Summary
FrequencyMetrics are written out every 60 seconds.
Exports toStackdriver Monitoring Custom Metrics

You can choose to export incoming events metrics, audience change metrics, or user metrics to Stackdriver for alerting and monitoring.

  1. Navigate to the Google integration in the Integrations section of Lytics. Google Cloud Integration Title

  2. Select one of the export options: Export Events, Export Segment Changes, or Export Users based on what you would like to monitor in Stackdriver. Export options

  3. Select the JWT service account authorization you created in the authorization step.

  4. Configure the export options. The configuration options will vary based on the workflow you selected, but all exports require you to select a Google Project and Dataset (be sure to use the Project ID listed in the Google Console Dashboard for your project).
    Configuration

  5. Once you have finished the configuration step, click Start Export.

  6. After the workflow has been started, you should be able to find metrics in Stackdriver Metrics Explorer (may take up to 10 minutes): Stackdriver metrics explorer

Using the Metrics

Once you have the metrics imported, you can now setup dashboards and alerting.