Editing the MQL Expression When Updating an Alarm

Directly edit an alarm's MQL expression when you update the alarm.

For an example MQL expression, see Example Query and Metric Chart. For information about components of MQL expressions, see the tasks listed under Querying Metric Data. For information about all query elements, including compartment and metric namespace, see Creating a Query.

For alarm troubleshooting, see Troubleshooting Alarms. See also Creating a Basic Alarm.

  • On the Edit alarm page in the Console, the MQL expression is available in Advanced mode only.
    1. On the Alarm Definitions list page, select the alarm that you want to work with. If you need help finding the list page or the alarm, see Listing Alarms.
    2. Go to Actions and then select Edit alarm.
    3. On the Edit alarm page, select Switch to Advanced Mode.
    4. Edit the text in the Query code editor box.
    5. Update any other values for the alarm, as needed.
      For more information about the fields, see Creating a Basic Alarm.
    6. Select Save alarm.
  • Use the oci monitoring alarm update command and required parameters to update an alarm. Use the --query-text parameter to specify 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 specify the MQL expression.