Editing the MQL Expression When Creating an Alarm

Directly edit an alarm's MQL expression when you create the alarm in Monitoring.

For an example MQL expression, see Example Query and Metric Chart. For information about all query elements, including compartment and metric namespace, see Creating a Query.

For alarm troubleshooting, see Troubleshooting Alarms.

  • On the Create Alarm page in the Console, the MQL expression is available in Advanced mode only.

    1. Open the navigation menu and click Observability & Management. Under Monitoring, click Alarm Definitions.
    2. Click Create Alarm.
    3. (Optional) To prepopulate the MQL expression with required fields, in the Metric description section on the Create Alarm page, select a metric namespace and metric name.
    4. At the top of the page, click Switch to Advanced Mode.
      The Metric description area is relabeled to Metric description, dimensions, and trigger rule.
    5. In that area, edit the text in the Query code editor box.
    6. Provide values for the remaining fields.
      For reference, see Creating a Basic Alarm.
    7. Click Save alarm.
  • Use the oci monitoring alarm create command and required parameters to create an alarm. Use the --query-text parameter to specify the MQL expression.

    oci monitoring alarm create [...] --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 CreateAlarm operation to create an alarm. Use the query attribute to specify the MQL expression.