This topic describes how to create a custom metric.
You can create a metric by using the following three methods:
- Method 1: On the
Custom Monitoring page, clickCreate Metric in the upper-right corner. - Method 2: If no metrics are created, go to the
Custom Monitoring page, and clickCreate Metric on theMetrics tab. - Method 3: If no charts are created, go to the
Custom Monitoring page, and clickCreate Metric on the Charts tab.
Prerequisites
Make sure that you have the following permissions:
-
Resource Permissions : Cluster Read-only, Tenant Read-only, OBProxy Read-only, Arbitration Service Read-only, Binlog Service Read-only, or Host Read-only permission -
Menu Permissions : Permission on theAll menu ofPerformance Monitoring
Procedure
The following procedure demonstrates how to use Method 1.
Log on to the OCP console.
In the left-side navigation pane, choose
Performance Monitoring .Click
Custom Monitoring in the upper-right corner.On the
Custom Monitoring page, clickCreate Metric in the upper-right corner.In the panel that appears on the right, set the parameters.
Parameter Description Metric Name The unique identifier of the metric in OCP. A metric name can contain uppercase and lowercase letters, digits, and underscores (_). It must start with a letter and end with a letter or digit, and must be 2 to 48 characters in length. Metric Description The additional information about the metric. Creation Mode The way in which to create the metric. Valid values: Select Expression andCustom Expression .- If you select
Select Expression mode, you can use built-in collection items and expressions of OCP. - If you select
Custom Expression mode, you must specify an expression for the metric.
Collection Item The collection item to use for the metric. This parameter is displayed if you select Select Expression forCreation Mode . You can move the pointer over the selected collection item to view its details in the tooltip that appears.
The drop-down list contains all built-in collection items of OCP. For more information, see View collection items.Evaluate Expression The expression, in a PromQL-like syntax, that OCP uses to indicate the data source of the metric. - LABELS represents the filtering dimension. Data is filtered based on these labels.
- GBLABELS represents the aggregate dimension. The selected data is aggregated based on this information.
- INTERVAL represents the range vector selector for range queries in PromQL. It is used by only functions such as rate() and delta().
Unit Optional. The unit of the metric. - -: This is the default value.
- Data unit:
- bits
- bytes
- KB
- MB
- GB
- TB
- PB
- Time unit:
- Microseconds (µs)
- Milliseconds (ms)
- Seconds (s)
- Minutes
- Others: %
- If you select
Click
OK .