Learn about Alertmanager, an open-source alerting system designed to work with Prometheus for alerting and monitoring.
Alert manager
Alertmanager handles deduplication, grouping and routing of alerts to the appropriate receiver integrations, such as email and PagerDuty. It also manages alert silencing and inhibition. Alertmanager must be installed on the cluster with the service exposed on
port
and
targetPort 9093
..
If Alertmanager is installed on the cluster, add a default receiver in the Alertmanager ConfigMap under the receivers section.
Prometheus
Prometheus is an open-source monitoring framework. It provides out-of-the-box monitoring capabilities for the Kubernetes container orchestration platform. It scrapes metrics from instrumented jobs and stores all collected samples locally. It then processes this data and generates alerts.
Prometheus must be installed on the cluster with the service exposed on
port
and
targetPort 9090
. If Prometheus is installed, Alertmanager requires data in a specific format to display relevant alerts in the UI. Therefore, in the ConfigMap used to externalize Prometheus (config-map.yaml), pod-level queries must include the namespace, pod name, and alert description under the alert configuration.
In the previous example, the pod-level query is defined by
expr
, which creates an alert if the pod is using more CPU. The output of
expr
should contain the namespace and the pod name. To add these values in Alert manager, produce the output using
$labels
under
labels section
.
Along with Prometheus,
node-exporter
must also be installed to collect node-level metrics such as memory and CPU usage.
Prometheus cloud providers
Prometheus must be configured for each cloud service provider to collect metrics for its monitoring framework. For configuration details, refer to the providers listed below: