Skip to main content

Version: 3.2.14.6

Alert Template

An alert notification template is a pre-set template designed to dynamically generate alert messages by filling in placeholders with specific details at runtime. The placeholders are configured with variables in the template. It utilizes Go’s templating syntax to inject values such as the title, alert time, severity, and detailed description of the alert.

Variables

Template variables are data evaluations in the template that are delimited by {{ and }}.

The following variables are available to be used in creating alert notification template.

VariableDescription
{{ .Name }}Name of the alert policy.
{{ .Description }}Description of the alert policy.
{{ .Severity }}Severity of the alert policy.
{{ .Class }}Class of the alert policy.
{{ .Title }}Alert title.
{{ .Detail }}Alert detail.
{{ .AlertTime }}Time of the alert.
{{ .AlertEvents }}Condition that triggered the alert.

Alert Time

Alert Events

  • {{ .AlertEvents.number_of_status_code.Summary }}: Summary of the number of status codes.
  • {{ .AlertEvents.ratio_of_status_code.Summary }}: Summary of the ratio of status codes.
  • {{ .AlertEvents.control_plane_certificate_will_expire_in.Summary }}: Summary of the control plane certificate that will expire.
  • {{ .AlertEvents.gateway_certificate_will_expire_in.Summary }}: Summary of the gateway certificate that will expire.
  • {{ .AlertEvents.gateway_instance_offline.Summary }}: Summary of the offline gateway instances.
  • {{ .AlertEvents.dp_core_exceeded.Summary }}: Summary of the time period the gateway instance CPU cores exceeds the maximum allowed CPU cores by license, which may affect new configuration changes.

Examples

Alert with Title, Time, Severity, and Detail

API7 alert! See details below.
Title: {{ .Title }}
AlertTime: {{ .AlertTime.Format "2006 Jan 02 15:04:05" }}
Severity: {{ .Severity }}
Detail: {{ .Detail }}

Identify Alert Triggers

Alert triggered by
{{if .AlertEvents.dp_core_exceeded }} {{ .AlertEvents.dp_core_exceeded.Summary }} {{end}}
{{if .AlertEvents.gateway_instance_offline }} {{ .AlertEvents.gateway_instance_offline.Summary }} {{end}}

API7.ai Logo

API Management for Modern Architectures with Edge, API Gateway, Kubernetes, and Service Mesh.

Product

API7 Cloud

SOC2 Type IIISO 27001HIPAAGDPRRed Herring

Copyright © APISEVEN Ltd. 2019 – 2024. Apache, Apache APISIX, APISIX, and associated open source project names are trademarks of the

Apache Software Foundation