Create alert with Prometheus ΒΆ

This guide shows you how to create alerts for your application.

Prerequisites ΒΆ

You can define alerts by using Kubernetes resources (PrometheusRule), as well as directly in Grafana (GUI based).

You will have a separate Alertmanager for each environment available at <<tenant_url("alertmanager.<MY-ENV>")>>.

Create PrometheusRule ΒΆ

We use native Prometheus alert rules, and let Alertmanager handle the notifications.

You can define alerts by creating a PrometheusRule resource in your teams namespace.

.nais/alert.yaml

yaml

Activate the alert ΒΆ

Add the file to your application repository, alongside nais.yaml to deploy with Nais github action.

bash

Verify your alert ΒΆ

You can see the alerts in the Alertmanager at <<tenant_url("alertmanager.<MY-ENV>")>> and the defined rules in Prometheus at <<tenant_url("prometheus.<MY-ENV>")>>

Learn more ΒΆ

πŸ’‘ Advanced alerting with Prometheus πŸ“– Prometheus alerts reference