Customizing the Absence Detection Period for an Alarm Query

Specify a custom value for the absence detection period to use when querying metric data in an alarm in Monitoring.

The default absence detection period is two hours. An alarm query containing absent() uses the default.

Valid values range from one minute (1m) to three days (3d or 72h). Specify the amount of time in the absence detection period using a number and unit (m, h, or d for minute, hour, or day).

Example alarm query for a custom absence detection period of 20 hours:

CpuUtilization[1m]{resourceId = "<resource_identifier>"}.absent(20h)

For more information about the absence detection period, see Absence Alarm Example. For alarm troubleshooting, see Troubleshooting Alarms.

    1. Create a basic alarm query.
    2. In the Trigger rule section in the Create Alarm, configure the absence trigger:
      • Operator: Select absent.
      • Trigger delay minutes: Enter the number of minutes that the condition must be maintained before the alarm is in the firing state.

      Alternatively, click Switch to Advanced Mode to use MQL.

    3. To customize the absence detection period:
      The default absence detection period is two hours. For more information about the absence detection period, see Absence Alarm Example.
      1. At the top of the page, click Switch to Advanced Mode.
        The query appears in Monitoring Query Language (MQL), in the Query code editor box. Example:
        CpuUtilization[1m]{resourceId = "<resource_identifier>"}.absent()
      2. Replace absent() with absent(<number-and-unit).
        Valid values range from one minute (1m) to three days (3d or 72h). Specify the amount of time in the absence detection period using a number and unit (m, h, or d for minute, hour, or day).
        Example (20-hour absence detection period):
        CpuUtilization[1m]{resourceId = "<resource_identifier>"}.absent(20h)
    4. Update any other values for the alarm, as needed.
      For more information about the fields, see Creating a Basic Alarm.
    5. Click Save alarm.
  • Use the oci monitoring alarm update command and required parameters to update an alarm. Use the --query-text parameter to specify the custom absence detection period (part of the MQL expression, such as absent(20h)).

    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 custom absence detection period (part of the MQL expression, such as absent(20h)).