# Alerts

The reference to declaring an alert in any YAML file within the .baselime folder.

# Alert ID
  # Required: Type of resource, must be "alert"
  type: alert

  # Required: The properties of the resource
    # Optional: Name of the alert
    name: demo name
    # Optional: Description of the alert
    description: demo description
    # Required: Alert parameters
      # Required: The id of query to run at regular intervals for the alert. This query must be within the same application as the alert. 
      # Please note that if the query has multiple calculations, the alert will be based off the first listed calculation in the array of calculations of the query
      query: !ref id-of-an-existing-query

      # Required: The frequency reprensents how often to check for the threshold condition: in minutes or using a cron declaring [https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html#CronExpressions]
      frequency: 30 # or a cron expression - 0/30 * * * ? *

      # Required: The duration is the time range, in minutes, of data that the alert will check. 
      duration: 30
      # Required: The threshold is a string representing the condition to be met to trigger an alert
      threshold: "> 200"
      # Required: Channels are the ids of the recipients to notify when the threshold condition is met. All channels must be within the same application as the alert 
        - !ref id-of-an-existing-channel
        - !ref id-of-another-existing-channel
        - !ref id-of-a-third-existing-channel

# Alert threshold

The alert threshold is a string that can be represented as <operation> <value>

  • <operation>: an operation used to compare the first results of the query against the value. For further details, please check the list of accepted operations.
  • <value>: the value to compare the first result of the query against.