Alertmanager to Zulip is a simple Go program that forwards alerts from Alertmanager using the webhook receiver to a Zulip stream. I built it while I was deploying a Prometheus/Alertmanager monitoring stack at Zazuko.

It uses the same template context as in Alertmanager, for the message content as well as the stream name. Here is the template we use at Zazuko:

{{ with $ := . -}}
**[{{ .Status | toUpper }}{{ if eq .Status "firing" }}:{{ .Alerts.Firing | len }}{{ end }}]** {{ .GroupLabels.SortedPairs.Values | join " " }}

{{- if (and .CommonAnnotations.summary (eq .Status "firing")) }}
> {{ .CommonAnnotations.summary }}
{{ end -}}

{{- if .CommonAnnotations.runbook_url }}
**[View runbook]({{ .CommonAnnotations.runbook_url }})**
{{ end -}}

{{- if gt (len .CommonLabels) (len .GroupLabels) -}}
  {{- with .CommonLabels.Remove .GroupLabels.Names }}
{{ range .Names }}| {{ . }} {{ end }}
{{ range .Names }}| --- {{ end }}
{{ range .Values }}| {{ . }} {{ end }}
  {{ end }}
{{- end -}}

{{- range $alert := .Alerts.Firing }}
 - {{ or $alert.Annotations.message $alert.Annotations.description }}
   {{- range $key, $value := ($alert.Labels.Remove $.CommonLabels.Names) }} `{{ $key }}={{ $value }}`{{- end }}
{{- end }}
{{- end }}

Which yields this kind of alerts: