Using Dynamic Variables in Alarm Messages

Update an alarm in Monitoring to include values of alarm message parameters in messages.

See also Creating a Basic Alarm.

How Dynamic Variables are Rendered

Note

Insert dynamic variables that respect the maximum length for all supported use cases. Dynamic variables that exceed the maximum are considered invalid. For example, consider a dynamic variable for use in title. A supported use case for title is an email subject line, at a maximum length of 250 characters. In this case, the dynamic variable for a resource name ({{dimensions.<dimension-name>}}) is invalid because it's 256 characters and thus exceeds the maximum.

The value of an alarm message parameter is rendered in an alarm message when you insert the associated dynamic variable into supported fields. For example, enter the following as the alarm body:

{{severity}} alarm triggered because threshold got breached due to {{metricValues}} at {{timestamp}}

In the following image of an alarm message, the alarm body (Body) is rendered as: CRITICAL alarm triggered because threshold got breached due to [CpuUtilization[1m].mean():92] at 2023-08-15T19:51:00Z

Example of dynamic variables rendered in a formatted email message.

Dynamic variables appear in notifications that contain body elements.

  • If data is available for a dynamic variable, then the variable is resolved and data appears in its place. The previous example alarm message shows [CpuUtilization[1m].mean():92] in place of the dynamic variable {{metricValues}}.
  • If no data is available for a dynamic variable, then the variable is unresolved and it appears as coded. For example, if no metric values are available for the dynamic variable {{metricValues}}, such as when the alarm is in the OK state, then the dynamic variable {{metricValues}} appears in the alarm message.
  • SMS messages lack body elements, so dynamic variables aren't resolved.

Looking Up Dynamic Variables

To look up a dynamic variable for a parameter, see Dynamic Variables.