Creating custom metrics and alerts
Published 08 March 2018
What is a custom metric?
By default, SQL Monitor collects a standard set of Machine, SQL Server and Database metrics from every monitored object. It does so by running a T-SQL query against the objects at regular intervals and displaying the collected values as data points on the Analysis page.
Custom metrics are different; you add your own T-SQL query, choose the instances and databases to collect from, and specify the frequency of collection. This means data unique to your server environment can be collected and analyzed. Each time the query runs, a single, numeric value is collected. Values are displayed as data points on the Analysis page when you select a custom metric from the Show drop-down list:
What is a custom alert?
A custom alert warns you when a custom metric value passes a specified threshold for a certain duration. Adding a custom alert is optional, but it is a useful way of finding out if the values collected by a custom metric suggest problems with your databases.
Custom alerts are Continuous alerts that are raised at a defined level (Low, Medium or High). They can have the following status:
- Active: the issue that triggered the alert is still a problem
- Ended: the issue has been resolved
You can configure multiple thresholds so that if the collected metric value changes, the Active alert will automatically escalate or downgrade from the threshold level at which it was raised.
How do I create a custom metric and alert?
A simple wizard guides you through each step of the creation process.
If you don't want to create a custom metric and alert from scratch, we've provided a website, SQL Monitor Metrics, containing a range of metrics that you can install automatically.
To create a custom metric:
- Go to the Configuration tab. Under Alerts and metrics, select Custom metrics:
- Click the Create custom metric button: