Skip to main content

Webhook

In addition to built-in notification integrations like Slack, Microsoft Teams, Pagerduty, and Opsgenie, Coroot can integrate with nearly any system using Webhooks.

To configure a Webhook integration:

  • Go to the Project SettingsIntegrations
  • Create a Webhook integration
  • Paste a Webhook URL to the form Coroot Webhook integration
  • Configure HTTP basic authentication and headers if required.
  • Define templates for incidents and deployments.
  • Send a test alert to check the integration.

Template data

Notification templates are based on the Go templating system. Coroot applies provided templates to the following data structures:

type IncidentTemplateValues struct {
Status string // OK, WARNING, CRITICAL
Application struct {
Namespace string
Kind string
Name string
}
Reports []struct {
Name string // SLO, CPU, Memory, Net, ...
Check string // Availability, Latency, Memory leak, ...
Message string // "error budget burn rate is 26x within 1 hour", "app containers have been restarted 11 times by the OOM killer", ...
}
URL string // backlink to the incident page
}
type DeploymentTemplateValues struct {
Status string // Deployed, Cancelled, Stuck
Application struct {
Namespace string
Kind string
Name string
}
Version string // deployed application version
Summary []string // "Availability: 87% (objective: 99%)", "CPU usage: +21% (+$37/mo)", "Memory: a memory leak detected", ...
URL string // backlink to the deployment page
}

Examples

If you want to customize the message format, you can utilize Go templating syntax to modify alert or deployment notifications based on the provided data structure. Below are sample templates you can use as examples.

Incident template:

{{- if eq .Status `OK` }}
{{ .Application.Name }}@{{ .Application.Namespace }} incident resolved
{{- else }}
{{ .Status }} {{ .Application.Name }}@{{ .Application.Namespace }} is not meeting its SLOs
{{- end }}
{{- range .Reports }}
• *{{ .Name }}* / {{ .Check }}: {{ .Message }}
{{- end }}
{{ .URL }}

Deployment template:

Deployment of {{ .Application.Name }}@{{ .Application.Namespace }}
*Status*: {{ .Status }}
*Version*: {{ .Version }}
{{- if .Summary }}
*Summary*:
{{- range .Summary }}
• {{ . }}
{{- end }}
{{- end }}
{{ .URL }}