44.2. Creating an SQL Metric #
In the navigation panel, go to Infrastructure → Instances.
Click the name of the instance.
In the navigation panel, go to Metrics → SQL metrics.
In the top-right corner of the page, click Add SQL metric.
Specify parameters of the new SQL metric (parameters marked with an asterisk are required):
Name.
Database: The database where the query will be executed.
User: The system role on behalf of which the query will be executed.
Collection interval: The frequency of data collection.
Query: The SQL query based on which the metric is computed.
Important
Use queries with aggregate functions, such as
COUNT,SUM, andAVG. The instance can fail when using metrics based on queries returning more than one row or separate values, for example,SELECT 1.Instance restart is required: Specifies whether to restart the instance.
Click Add.