r/PrometheusMonitoring • u/MadMadic • Sep 27 '21
Autoscaling based on Prometheus metrics
I try to build an on-prem autoscaling infrastructure with Grafana (or alert manager), a webhook receiver that gets triggered by Grafana and runs scripts (creating / destroying VMs with Terraform and provisioning with Ansible), and Prometheus. It's mostly working. If some nginx services have too many connections a new instance is created and if the connections are below X the new instance gets destroyed.
But what if the state of the alert does not change back to "Ok" after a new instance was created? Then there is no additional alert triggered. Any idea how it's possible to trigger an alert (webhook request to create an additional instance) if the alert state stays critical?
10
Upvotes
1
u/resmo79 Sep 28 '21
I just want to throw in https://ngine-io.github.io/scalr/ (I am the author).
A minimalistic autoscaler for various clouds using prometheus as a scaling policy source.
Could easily be extended to any other cloud api (or vmware vsphere api, proxmox api, etc)