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.
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.
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.
- In the Google Cloud console under IAM & Admin select Service Accounts.
- Click + Create Service Account
Enter the details for your new service account and click Create.
From the Role dropdown, select the Monitoring Editor and click Continue to grant these permissions to your account.
Click + Create Key to download the private key you will need for authorization in Lytics.
For the key type select JSON and click Create to download the key as a JSON file.
In Lytics, navigate to the Google integration in the Integrations section of Lytics.
Select any integration option to begin authorization setup.
Click Add new authorization.
Paste the JWT into the JSON Service Account JSON text box.
Add a description for your authorization.
Export Metrics To Stackdriver
|Frequency||Metrics are written out every 60 seconds.|
|Exports to||Stackdriver Monitoring Custom Metrics|
You can choose to export incoming events metrics, audience change metrics, or user metrics to Stackdriver for alerting and monitoring.
Navigate to the Google integration in the Integrations section of Lytics.
Select one of the export options: Export Events, Export Segment Changes, or Export Users based on what you would like to monitor in Stackdriver.
Select the JWT service account authorization you created in the authorization step.
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).
Once you have finished the configuration step, click Start Export.
After the workflow has been started, you should be able to find metrics in Stackdriver Metrics Explorer (may take up to 10 minutes):
Using the Metrics
Once you have the metrics imported, you can now setup dashboards and alerting.