Enrich Alerts with Bash ScriptsΒΆ
Robusta can add extra context to your Prometheus alerts, so you can respond to alerts faster.
In this tutorial, you will enrich an alert by running a bash script automatically.
ImplementationΒΆ
When the CPUThrottlingHigh
alert fires we can run ps aux
to see which process has high CPU.
Add the following YAML to the customPlaybooks
Helm value and update Robusta:
customPlaybooks:
- triggers:
- on_prometheus_alert:
alert_name: CPUThrottlingHigh
actions:
- node_bash_enricher:
bash_command: ps aux | head -n 5
TestingΒΆ
Trigger the alert we defined by deploying a Pod that consumes a lot of CPU:
kubectl apply -f https://raw.githubusercontent.com/robusta-dev/kubernetes-demos/main/cpu_throttling/throttling.yaml
Sample AlertΒΆ
![](../../_images/custom_alert_with_bash_enrichment1.png)
Further ReadingΒΆ
View all Prometheus enrichment actions