When configuring a monitor, you can apply different messages and alert propagation channels for each condition by using conditional variables in the “Notify your team” section.
Conditional Variables | These allow certain text to be displayed based on specified conditions. |
---|---|
| 발생한 알람이 |
| 발생한 알람이 |
| 컨텍스트가 제공된 하위 문자열과 일치합니다. |
| 컨텍스트가 제공된 하위 문자열과 일치하지 않습니다. |
| 컨텍스트가 제공된 문자열과 정확히 일치합니다. |
| 컨텍스트가 제공된 문자열과 정확히 일치하지 않습니다. |
| 발생한 알람이 |
| 발생한 알람이 |
| 발생한 알람이 |
| 발생한 알람이 |
| 발생한 알람이 |
| 발생한 알람이 |
| 발생한 알람이 |
| 발생한 알람이 |
| 발생한 알람이 |
| 발생한 알람이 |
| 발생한 알람이 |
| 발생한 알람이 |
| 발생한 알람이 |
| 발생한 알람이 |
| 모니터에 설정된 priority가 value 입니다. ( |
| 모니터가 알 수 없는 상태입니다. |
| 모니터가 알 수 없는 상태가 아닙니다. |
| 모니터가 다시 알림 중입니다. |
| 모니터가 다시 알리지 않습니다. |
If you want to configure different propagation channels and messages based on a specific tag value,
it is recommended to create a new monitor or clone an existing one for each propagation channel, and create monitors per system individually.
Using multiple propagation channels in a single monitor may lead to different owners or management channels overseeing one monitor,
which requires alignment on common conditions such as thresholds.
Also, incorrect changes could affect multiple channels simultaneously.
For this reason, the method below should be used minimally and only when management is not an issue.
To apply conditions in the “Notify your team” message field,
you can use the following conditional variables from the list shown above:
{{#is_match "변수" "value1" "value2" }}{{/is_match}}
: Applies when the value of a specific variable contains the defined values.
{{^is_match "변수" "value1" "value2" }}{{/is_match}}
: Applies when the value of a specific variable does not contain the defined values.
{{#is_exact_match "변수" "value1" "value2" }}{{/is_exact_match}}
: Applies when the value of a specific variable exactly matches the defined values.
{{^is_exact_match "변수" "value1" "value2" }} {{/is_exact_match}}
: Applies when the value of a specific variable does not exactly match the defined values.
You can define multiple strings for a single variable (applied as an OR condition).
Example: {{#is_match "host.env" "dev" "stg" }}
This applies when the value of host.env
is either dev
or stg
, and you can define messages or channels accordingly. {{/is_match}}
You can use conditional variables just like if/else
statements in programming.
(Both of the following patterns are valid.)
{{#is_match "host.env" "prod"}} @채널_prod {{else}} @채널_dev {{/is_match}}
{{#is_match "host.service" "zmon" "slack"}} @채널_zmon {{else}} {{#is_match "host.service" "datadog"}} @채널_datadog {{else}} @채널_etc {{/is_match}} {{/is_match}}