With the alerts firing from Prometheus into Alertmanager, the only thing left to do is to send requests to Jenkins to scale the service. We already created a similar Alertmanager config in one of the previous chapters, so we'll comment only on a few minor differences. The configuration is injected into the alert-manager service as a Docker secret.
Since secrets are immutable, we cannot update the one that is currently used. Instead, we'll have to remove the stack and the secret and create them again.
docker stack rm monitor docker secret rm alert_manager_config
Now we can create a new secret with the updated Alertmanager configuration.
echo "route: group_by: [service,scale] repeat_interval: 5m group_interval: 5m receiver: 'slack' routes: - match: service: 'go-demo_main' scale...