<p>On a Kubernetes cluster with CoreOS Prometheus Operator scraping all standard cluster metrics, what Prometheus metric would show me the <code>currentCPUUtilizationPercentage</code> value for a simple HPA (horizontal pod autoscaler)?</p>
<p>If I setup a simple hpa like:</p>
<pre class="lang-sh prettyprint-override"><code>$ kubectl autoscale deployment php-apache --cpu-percent=30 --min=3 --max=10
</code></pre>
<p>And then if I do <code>kubectl get hpa php-apache -o yaml</code> I see something like:</p>
<pre class="lang-yaml prettyprint-override"><code>spec:
  maxReplicas: 10
  minReplicas: 3
  targetCPUUtilizationPercentage: 30
  ...
status:
  currentCPUUtilizationPercentage: 28
  currentReplicas: 9
  desiredReplicas: 9
  ...
</code></pre>
<p>I want to see that <code>currentCPUUtilizationPercentage</code> in Prometheus. I've done a bunch of Prometheus queries to look for this.</p>
<p>I've searched all metrics tagged <code>{hpa=&quot;php-apache&quot;}</code> and I see many hpa metrics, but not the metric I'm looking or. I can see <code>kube_hpa_spec_target_metric</code> set to 30 and I can see current status metrics like <code>kube_hpa_status_condition</code> but not the current cpu metric value that I want to see.</p>
<p>I've searched all metrics tagged <code>{metric_name=&quot;cpu&quot;}</code> and only see <code>kube_hpa_spec_target_metric</code></p>
<p>I've searched all container and pod related metrics tagged <code>{container=&quot;my-container-name&quot;}</code> and <code>{pod=~&quot;my-pod-prefix.*&quot;}</code> and I see several cpu related metrics like <code>container_cpu_usage_seconds_total</code> abnd <code>container_spec_cpu_quota</code> but nothing similar to or nothing that seems to be able to be used in calculating the <code>currentCPUUtilizationPercentage</code> value that I'm looking for?</p>
<p>FYI, this is on Kubernetes 1.17.x and using a recent version of CoreOS Prometheus Operator.</p>

clay
<p>If I remember correctly currentCPUUtilizationPercentage is a k8 internal metrics for HPA and not exposed directly  as a metrics you can <strong>scrape</strong> with Prometheus.
see <a href="https://github.com/kubernetes/community/blob/master/contributors/design-proposals/autoscaling/horizontal-pod-autoscaler.md#autoscaling-algorithm" rel="nofollow noreferrer">https://github.com/kubernetes/community/blob/master/contributors/design-proposals/autoscaling/horizontal-pod-autoscaler.md#autoscaling-algorithm</a></p>
<p>you probably could <strong>scrape</strong> component of currentCPUUtilizationPercentage  metrics and create custom metrics to see it in Prometheus.</p>
