# you can disable an alarm notification by setting the 'to' line to: silent

# --- Availability ---

 template: am_key_vault_availability
       on: azure_monitor.key_vault.availability
    class: Availability
     type: Certificates
component: Azure Key Vault
   lookup: average -5m unaligned of average
    units: percentage
    every: 1m
     warn: $this < (($status >= $WARNING)  ? (99.9) : (99))
     crit: $this < (($status == $CRITICAL) ? (99)   : (90))
    delay: down 5m multiplier 1.5 max 1h
  summary: Key Vault availability on ${label:resource_name}
     info: Overall vault availability of Azure Key Vault ${label:resource_name} \
           in ${label:resource_group} (${label:region}). \
           Azure SLA guarantees 99.99% availability
       to: sysadmin

# --- Latency ---

 template: am_key_vault_api_latency
       on: azure_monitor.key_vault.api_latency
    class: Latency
     type: Certificates
component: Azure Key Vault
   lookup: average -5m unaligned of average
    units: milliseconds
    every: 1m
     warn: $this > (($status >= $WARNING)  ? (500)  : (1000))
     crit: $this > (($status == $CRITICAL) ? (1000) : (2000))
    delay: down 5m multiplier 1.5 max 1h
  summary: Key Vault API latency on ${label:resource_name}
     info: Average API latency of Azure Key Vault ${label:resource_name} \
           in ${label:resource_group} (${label:region}). \
           High latency may indicate throttling or service degradation
       to: sysadmin

# --- Saturation ---

 template: am_key_vault_saturation
       on: azure_monitor.key_vault.saturation
    class: Utilization
     type: Certificates
component: Azure Key Vault
   lookup: average -5m unaligned of average
    units: percentage
    every: 1m
     warn: $this > (($status >= $WARNING)  ? (60) : (75))
     crit: $this > (($status == $CRITICAL) ? (75) : (90))
    delay: down 5m multiplier 1.5 max 1h
  summary: Key Vault saturation on ${label:resource_name}
     info: Vault saturation of Azure Key Vault ${label:resource_name} \
           in ${label:resource_group} (${label:region}). \
           High saturation means the vault is approaching its transaction limits
       to: sysadmin
