Setting up alerts based on Prometheus metrics
Grafana supports configuring of alerts based on the metrics aggregated by the connected data-sources. Read more about it in the below page.
Bahmni out of the box comes with few common alert rules configured. The following are the out-of-the box alerts and configuration.
Node Level Alerts (defined in node_alerts_group.yaml)
High CPU Usage Alert if utilisation > 75%
Low Memory Availability Alert if available memory < 30%
Low Disk Space Alert if available space < 30%
Container Level Alerts (defined in container_alert_group.yaml)
Container High CPU Usage Alert if CPU usage of container > 50%
Container High Memory Usage Alert if memory usage > 1024 MB (except OpenMRS container)
Container High Memory Usage Alert for OpenMRS if memory usage > 3000 MB
There is also a default SMTP alerting contact point and notification policy which comes configured out of the box. There are numerous notification contact points that can be integrated with Grafana for alerting. Read about it here.
Configuring SMTP to receive alerts on email
Update the values of SMTP server details in the .env file in the bahmni-observability directory
SMTP_HOST= SMTP_USERNAME= SMTP_PASSWORD= SMTP_FROM_NAME= SMTP_FROM_ADDRESS=
Configure the receiver email address. There are two environment variables which are available to send the email alerts to. The
DEFAULT_ALERT_MAIL_RECEIVER
variable is used to send all the emails. TheCRITICAL_ALERT_MAIL_RECEIVER
variable is used to configure the list of address for whom only critical and high severity alerts will be sent. Bothof these variable support comma separated input for multiple email adress.
Example:DEFAULT_ALERT_MAIL_RECEIVER=example@example.com CRITICAL_ALERT_MAIL_RECEIVER=example1@example.com, example2@example.com
Once completing the configuration, update the Grafana service by running
docker compose --profile logging up -d grafana
The alert email content and subject lines are templates that can be configured. Refer to the files
mail_content_template.yaml
andmail_subject_template.yaml
under thebahmni-observability/config/alerting/
directory.
Updating the threshold values for alert rules
All the above mentioned default alerts are created using the configuration files in the bahmni-observability/config/alerting/
directory. You can update the alert threshold values in the node_alerts_group.yaml or container_alert_group.yaml files at the following snippet for each rule
conditions:
- evaluator:
params:
- 3000 (This number needs to be updated)
The Bahmni documentation is licensed under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)