title: Horizontal Pod Autoscaler (HPA) custom metrics with Prometheus Adapter (How are units defined?)
body: <p>I'm testing out HPA with custom metrics from application and exposing to K8s using Prometheus-adapter.</p>
  <p>My app exposes a &quot;jobs_executing&quot; custom metric that is a numerical valued guage (prometheus-client) in golang exposing number of jobs executed by the app (pod).</p>
  <p>Now to cater this in hpa, here is how my HPA configuration looks like:</p>
  <pre><code>apiVersion: autoscaling/v2beta2
  kind: HorizontalPodAutoscaler
  metadata:
    name: myapp
  spec:
    scaleTargetRef:
      apiVersion: apps/v1
      kind: Deployment
      name: myapp
    minReplicas: 1
    maxReplicas: 10
    metrics:
    - type: Pods
      pods:
        metric:
          name: jobs_executing
        target:
          type: AverageValue
          averageValue: 5
  </code></pre>
  <p>I want autoscaler to scale my pod when the average no. of jobs executed by overall pods equals &quot;5&quot;. This works, but sometimes the HPA configuration shows values like this:</p>
  <pre><code>NAME             REFERENCE                           TARGETS   MINPODS   MAXPODS   REPLICAS   AGE
  my-autoscaler    Deployment/my-scaling-sample-app    7700m/5     1         10        10       38m
  </code></pre>
  <p>here targets show up as &quot;7700m/5&quot; even though the average no. of jobs executed overall were 7.7. This makes HPA just scale horizontally aggressively. I don't understand why it is putting &quot;7700m&quot; in the current target value&quot;?</p>
  <p>My question is, if there is a way to define a flaoting point here in HPA that doesn't confuse a normal integer with a 7700m (CPU unit?)</p>
  <p>or what am I missing? Thank you</p>