Selecting a Resource for an Alarm Query
Limit returned metric data to a resource by selecting a resource-specific dimension when querying metric data for an alarm in Monitoring.
Available dimensions vary by metric.
This page describes how to query metrics from a resource through resource-specific dimensions. You can also access resource-specific metric charts by going to the resource's details page in the Console and creating an alarm from a predefined service query. See Viewing Default Metric Charts for a Single Resource and Creating an Alarm from a Default Metric Chart.
For alarm troubleshooting, see Troubleshooting Alarms.
For information about selecting a resource from the Metrics Explorer page, see Selecting a Resource for a Query.
- Open the navigation menu and click Observability & Management. Under Monitoring, click Alarm Definitions.
- Click the name of the alarm that you want to update.
- On the alarm details page, click Actions and then select Edit alarm.
- In the Metric description area, verify that the metric namespace and the metric name for which you want to specify dimensions are selected.
To select dimensions by using Basic mode (default), go to the Metric dimensions area and provide the following values:
Additional or other dimension fields appear for some metric namespaces. For example, a deployment type field appears for the
oci_autonomous_databasemetric namespace. See the service-specific documentation for details.
Dimension name: Select a qualifier that's specified in the metric definition. For example, the dimension
resourceIdis specified in the metric definition for
To select a specific resource within the selected compartment, filter results by a resource-specific dimension, such as resourceDisplayName.Note
Long lists of dimensions are trimmed.
- To view dimensions by name, type one or more characters in the box. A refreshed (trimmed) list shows matching dimension names.
- To retrieve all dimensions for a metric, see Listing Metric Definitions.
- Dimension value: Select the value to use for the specified dimension. For example, if you selected
resourceIdas the dimension, select the resource identifier for the instance that you're monitoring.
- Additional dimension: Add another name-value pair for a dimension, as needed.
To select a resource by updating the MQL expression, follow these steps:
- At the top of the Edit alarm page, click Switch to Advanced Mode.
- In the Metric description, dimensions, and trigger rule area, edit the text in the Query code editor box.
Update any other values for the alarm, as needed.
For more information about the fields, see Creating a Basic Alarm.
- Click Save alarm.
Use the oci monitoring alarm update command and required parameters to update an alarm. Use the
--query-textparameter to select resource-specific dimensions (part of the MQL expression).
oci monitoring alarm update [...] --query-text <mql_expression> [OPTIONS]
For a complete list of flags and variable options for CLI commands, see the Command Line Reference for Monitoring.
Run the UpdateAlarm operation to update an alarm. Use the
queryattribute to select resource-specific dimensions (part of the MQL expression).