<p>Also raised the issue here but not getting any response: <a href="https://github.com/kedacore/keda/issues/3669" rel="nofollow noreferrer">https://github.com/kedacore/keda/issues/3669</a></p>
<p>Trying to use this trigger: <a href="https://keda.sh/docs/2.8/scalers/metrics-api/" rel="nofollow noreferrer">https://keda.sh/docs/2.8/scalers/metrics-api/</a></p>
<p>I'm flexible on how I use it - here was my first attempt:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-keda-charlie
  namespace: tsew
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nginx-keda-charlie
  template:
    metadata:
      labels:
        app: nginx-keda-charlie
    spec:
      containers:
      - name: nginx-keda-charlie
        image: nginx
        imagePullPolicy: Always
---
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
  name: http-scaledobject
  namespace: tsew
  labels:
    deploymentName: nginx-keda-charlie
spec:
  scaleTargetRef:
    name:        nginx-keda-charlie
  triggers:
    - type: metrics-api
      metadata:
        metricType: Value
        targetValue: &quot;1&quot;
        url: &quot;http://mockbin.org/bin/9cb318e0-e8d8-4dc5-a18f-f6135a0e2d4a&quot;
        valueLocation: 'tasks'
</code></pre>
<p>But I get this error:</p>
<p>&quot;HorizontalPodAutoscaler.autoscaling &quot;keda-hpa-http-scaledobject&quot; is invalid: spec.metrics[0].external.target.averageValue: Invalid value: resource.Quantity{i:resource.int64Amount{value:0, scale:0}, d:resource.infDecAmount{Dec:(*inf.Dec)(nil)}, s:&quot;0&quot;, Format:&quot;DecimalSI&quot;}: must be positive&quot;</p>
<p>sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile
/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.12.3/pkg/internal/controller/controller.go:121
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler
/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.12.3/pkg/internal/controller/controller.go:320
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.12.3/pkg/internal/controller/controller.go:273
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2
/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.12.3/pkg/internal/controller/controller.go:234
2022-09-14T19:59:54Z ERROR Reconciler error {&quot;controller&quot;: &quot;scaledobject&quot;, &quot;controllerGroup&quot;: &quot;keda.sh&quot;, &quot;controllerKind&quot;: &quot;ScaledObject&quot;, &quot;scaledObject&quot;: {&quot;name&quot;:&quot;http-scaledobject&quot;,&quot;namespace&quot;:&quot;tsew&quot;}, &quot;namespace&quot;: &quot;tsew&quot;, &quot;name&quot;: &quot;http-scaledobject&quot;, &quot;reconcileID&quot;: &quot;a7d1c215-a585-4a65-b85d-ba1152746edf&quot;, &quot;error&quot;: &quot;HorizontalPodAutoscaler.autoscaling &quot;keda-hpa-http-scaledobject&quot; is invalid: spec.metrics[0].external.target.averageValue: Invalid value: resource.Quantity{i:resource.int64Amount{value:0, scale:0}, d:resource.infDecAmount{Dec:(*inf.Dec)(nil)}, s:&quot;0&quot;, Format:&quot;DecimalSI&quot;}: must be positive&quot;}
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.12.3/pkg/internal/controller/controller.go:273
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2
/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.12.3/pkg/internal/controller/controller.go:234</p>
<p>Steps to Reproduce the Problem</p>
<ul>
<li>install minikube v1.26.1 on OSX</li>
<li>Install KEDA like this kubectl apply
-f <a href="https://github.com/kedacore/keda/releases/download/v2.8.0/keda-2.8.0.yaml" rel="nofollow noreferrer">https://github.com/kedacore/keda/releases/download/v2.8.0/keda-2.8.0.yaml</a></li>
<li>kubectl apply -f deployment.yaml</li>
</ul>

Charlie
<p>Your metrics API trigger should return <code>application/json</code> in order for this to work. The endpoint in your example returns <code>Content-Type: text/html; charset=utf-8</code>. Try this mockbin instead: <a href="https://mockbin.org/bin/336a8d99-9e09-4f1f-979d-851a6d1b1423" rel="nofollow noreferrer">https://mockbin.org/bin/336a8d99-9e09-4f1f-979d-851a6d1b1423</a></p>
