HomeMogDBMogDB StackUqbar
v6.3

Documentation:v6.3

Supported Versions:

Metrics Management

Function Entrance

Monitor Alerts --> Metrics Management

Function Description

  1. View the platform's predefined collection metrics.
  2. Create, modify, and delete custom SQL/SHELL collection database metrics, which are collected by the platform through Prometheus.
  3. Set the retention period for collection metrics.

Operating Instructions

Collection Metrics List

The collection metrics list page displays various database types and host collection metrics currently available on the platform. The left-hand menu allows you to click and switch between views. The number after the name represents the quantity of collection metrics for that type.

img

The source field can distinguish whether the collection metric is predefined by the platform or created by the user. Predefined metrics can only be viewed and cannot be edited, deleted, or disabled.

img

Custom metrics support disabling, modifying, and deleting. These operations may cause the configured alerts and monitoring functions to fail, please proceed with caution!

Create Custom Metrics

If the platform's predefined collection items do not meet your needs, you can click the [Create] button to create a new metric collection.

img

img

Collection Metric Name: Supports input in Chinese, the display name of the metric within the platform.

Metric English Name: The unique identifier for the metric collection, in the Prometheus collection item command rules as: database type_custom_metric English name.

Metric Grouping: Host or MogDB/openGauss.

Enable Status: Enabled means automatically activated upon creation.

img

Collection Script Type: Supports SQL or SHELL.

Value Type:

  1. Direct value, Prometheus gauges, an increment-decrement metric type, monitoring and alerting calculate the directly obtained value.
  2. Cumulative value, Prometheus counters, an increment-only metric type, unless reset, monitoring and alerting calculate the incremental difference.

Collection Frequency: The interval time between two collections, default is 2 minutes.

Collection Dimension:

  1. Database Cluster: Collect by database, one database is collected once.
  2. Database Instance: Collect by instance, all instances will be collected.

Collection Scheme: Supports different collection scripts for different database versions or specified databases. The collection will automatically select the matching collection scheme for data collection. Schemes support adding, deleting, and modifying.

SQL Statement:

  1. The SQL statement for collection must be a select statement.
  2. The text must not exceed 10K.
  3. Fields must start with an English letter and can include numbers and underscores, dashes, to be consistent with Prometheus label tags.
  4. The last field must be numeric because the collected data will be summarized and displayed by Prometheus, and the last field serves as the Prometheus metric value, so it must be numeric.
  5. SQL statements can query up to 10 fields.
  6. The collection return value should not be too large to avoid affecting performance.
  7. Do not end the SQL statement with a semicolon.

SHELL Statement:

  1. The script return result must be in standard JSON format.
  2. The field names in the result can only be a combination of English letters, numbers, underscores, and dashes, starting with an English letter.
  3. The result can have no more than 10 fields.
  4. The last field will serve as the metric value, so it must be numeric.
  5. You can introduce variables to obtain current database information, please refer to the page prompts for variables of different database types.

After inputting the statement, click "Test SQL Statement" to test if the collection SQL can run normally.

img

You need to select a test database object in the pop-up window:

img

After a successful test, the result will be displayed:

img

All schemes must be tested and passed before you can click [Confirm] to save.

Wait for a while (about 2-3 minutes) and then log in to the platform's Prometheus management page to check if the collection is successful. The address is: http://platform_IP_address:8093. Enter the English name of the custom SQL metric collection, and it will automatically associate and display. Click "Execute" to run the query (there may be no data returned within the collection interval).

img

Click "Graph" to view historical collection values:

img

Data Retention Settings

You can set the retention period for the platform's collection metrics, which defaults to 30 days.

img

Copyright © 2011-2024 www.enmotech.com All rights reserved.