Integrating Alertmanager with Jenkins
At the moment, we are running Alertmanager configured in the previous chapter. It creates a Slack notification on all alerts. Let's try to change it so that alerts trigger a remote invocation of the Jenkins job service-scale.
Since Alertmanager configuration is stored as a Docker secret and they are immutable (we cannot update them), we need to remove the service and the secret and create them again.
docker service rm monitor_alert-manager docker secret rm alert_manager_config
Let us define a Slack config that will send build requests to the service-scale job. The command that creates the service with the configuration is as follows.
echo "route: group_by: [service] repeat_interval: 1h receiver: 'jenkins-go-demo_main' receivers: - name: 'jenkins-go-demo_main' webhook_configs: - send_resolved: false url: 'http://$(docker-machine ip swarm-1)/jenkins/job\ /service-scale/buildWithParameters?token=DevOps22&service=\ go-demo_main&scale...