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.

    1. Open the navigation menu and click Observability & Management. Under Monitoring, click Alarm Definitions.
    2. Click the name of the alarm that you want to update.
    3. On the alarm details page, click Actions and then select Edit alarm.
    4. In the Metric description area, verify that the metric namespace and the metric name for which you want to specify dimensions are selected.
    5. 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_database metric namespace. See the service-specific documentation for details.

      • Dimension name: Select a qualifier that's specified in the metric definition. For example, the dimension resourceId is specified in the metric definition for CpuUtilization.

        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 resourceId as 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.
    6. To select a resource by updating the MQL expression, follow these steps:
      1. At the top of the Edit alarm page, click Switch to Advanced Mode.
      2. In the Metric description, dimensions, and trigger rule area, edit the text in the Query code editor box.
    7. Update any other values for the alarm, as needed.
      For more information about the fields, see Creating a Basic Alarm.
    8. Click Save alarm.
  • Use the oci monitoring alarm update command and required parameters to update an alarm. Use the --query-text parameter to select resource-specific dimensions (part of the MQL expression).

    oci monitoring alarm update --query-text <mql_expression> [...]

    For a complete list of parameters and values for CLI commands, see the Command Line Reference for Monitoring.

  • Run the UpdateAlarm operation to update an alarm. Use the query attribute to select resource-specific dimensions (part of the MQL expression).