Scale SpringBoot App based on Thread Pool State Scale SpringBoot App based on Thread Pool State kubernetes kubernetes

Scale SpringBoot App based on Thread Pool State


  1. Enable Prometheus exporter in Spring

  2. Make sure metrics are scraped. You're going to watch for a threadpool_size metric. Refer your k8s/prometheus distro docs to get prometheus service discovery working for you.

  3. Write a horizontal pod autoscaler (HPA) based on a Prometheus metric:

Depending on what k8s distro you are using, you might have different ways to get the Prometheus and prometheus discovery: