Synthetic Monitoring using Grafana Labs
One of the most important quality metrics that engineering organizations tend to implement & track is ‘Service Availability’ in order to monitor the availability of the application from the lens of the actual users. This kind of targeted monitoring gives continuous and valuable information on uptime and status of the health of the application and can be useful for a variety of reasons, some of them being:
- Continuous production monitoring gives service level indicators on how the application is performing for actual users on a regular basis
- Regression monitoring helps Release Engineers be alerted of any degradation in service after a code is released to production
- Such directed monitoring helps non-engineering organizations like Customer Support & Account Management be alerted of any product issues in order to be pro-actively reach out to their customers and in general, be better prepared to serve their most loyal customers
At Quip (Salesforce), we researched various solutions for synthetic monitoring. One of them was Grafana Labs. This post will walk you through the steps on how to set up Synthetic Monitoring for your application using Grafana Labs in a handful of simple steps.
First, what is Grafana?
Grafana allows you to query, visualize, alert on and understand your metrics no matter where they are stored. (Source).
You can connect Grafana to various supported data sources to pull your data points and then use the magic of Grafana visualizations to build powerful dashboards.
Lets start with the simple setup.
- Create a Grafana Cloud Account
2. Download Synthetic Monitoring plugin by going through the following steps
3. Once you have downloaded the plugin, create a check. A check is a test you want to run. In this example it’ll be a link of the application you want to monitor.
In order to create a check, open ‘Checks’ from Synthetic Monitoring side panel
Click on ‘Add new check’. It will pop open the ‘Add check’ page. Make sure you Enable it. Fill in your Job name and target public url.
Add the appropriate probes you’d like your checks to execute on, relevant to your application.
Click Save.
You can also set thresholds for your checks by clicking on ‘Set Thresholds’ button. Or you can leave the default values.
A note on Probes
Grafana Labs provides 21 Public probes for you to run your tests on. Probes are are instances of Synthetic Monitoring agents distributed at different locations around the world. Tests are run on the Probes you select while creating the check and results are submitted in your Grafana Labs account. This is particularly useful if your users are concentrated in a few specific locations in the world and you’d like to monitor your applications in those specific locations. Once you create the checks and monitoring begins, you can see how the checks are performing on the various probes by going to the ‘Probes’ tab.
You can also create Private probes using these steps. For purpose of this blog post, public probes will suffice.
And finally, the visualizations
Once your checks are set, you can go to the Synthetic Monitoring homepage on the left panel to see the summary. The plugin provides a good set of out-of-the-box dashboard panels consisting of :
- A table view of all checks detailing reachability, uptime, status and availability metrics color coded based on the thresholds you determined while setting up the checks.
- Latency graphs over time duration
- A Worldmap panel detailing reachability for selected probes
- Error percentage graphs
What I loved about this solution:
- The out-of-the-graphs provided by the Synthetic Monitoring plugin are very powerful! With minimal effort, you can spin up visualizations giving fairly detailed availability metrics and help you gauge the health of your application.
- This plugin helps you dissect data across a specific time range, region or type of check.
- This setup does not need you to be an engineer. The setup is mostly declarative and hence anyone in your company can set this up.
Hope this blog post will help you as you begin your journey towards setting up Synthetic Monitoring for your applications.