<p>I have a spring boot application which is running in a Kubernete cluster successfully. But now I want to scale the application when we receive more traffic. So what are the metrics that I should consider if I am using Prometheus/Grafana combination in my application? The prometheus gives me lots of metrics, but I am a bit confused about which one should I use for HPA (Horizontal Pod scaling).</p>

Anson
<p>You should be using cpu or memory usage. say, if the usage goes above 80% scale the pods</p>

<p>sample based on cpu utilization</p>

<pre><code>apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
  name: php-apache
  namespace: default
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: php-apache
  minReplicas: 1
  maxReplicas: 10
  targetCPUUtilizationPercentage: 50
</code></pre>
