44.2. Creating an SQL Metric #

  1. In the navigation panel, go to InfrastructureInstances.

  2. Click the name of the instance.

  3. In the navigation panel, go to MetricsSQL metrics.

  4. In the top-right corner of the page, click Add SQL metric.

  5. 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, and AVG. 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.

  6. Click Add.