This topic describes how to create a custom metric.
Procedure
You can create a metric by using the following three methods:
- Method 1: On the Custom Monitoring page, click Create Metric in the upper-right corner.
- Method 2: If no metrics are created, go to the Custom Monitoring page, and click Create Metric on the Metrics tab.
- Method 3: If no charts are created, go to the Custom Monitoring page, and click Create Metric on the Charts tab.
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, click Create 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 and Custom 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 for Creation 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: %
Click OK.