<p>I am using <strong>DirectXMan12/k8s-prometheus-adapte</strong> to push the external metric from Prometheus to Kubernetes.</p>

<p>After pushing the external metric how can I verify the data is k8s?</p>

<p>When I hit <strong>kubectl get --raw /apis/external.metrics.k8s.io/v1beta1 | jq</strong> I got the following result but after that, I do not have an idea how to fetch actual metrics value</p>

<pre><code>{
  "kind": "APIResourceList",
  "apiVersion": "v1",
  "groupVersion": "external.metrics.k8s.io/v1beta1",
  "resources": [
   {
     "name": "subscription_back_log",
     "singularName": "",
     "namespaced": true,
     "kind": "ExternalMetricValueList",
     "verbs": [
       "get"
     ]
  }]
}
</code></pre>

Ravi Shah
<p>actual metric value is fetched per instance, for example, the metric you attached is <code>namespaced: true</code>, assuming the metric is for pods, you can access the actual data at </p>

<pre><code>kubectl get --raw "/apis/external.metrics.k8s.io/v1beta1/namespaces/wanted_namepsace/pods/*/subscription_back_log" | jq '.'
</code></pre>

<p>(or specify the pod name instead of *)</p>

<p>If you want HPA to read you metric, the configurations are (for example)</p>

<pre><code>apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
  name: your-hpa
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: your-pod
  minReplicas: 1
  maxReplicas: 10
  metrics:
  - pods:
      metricName: subscription_back_log
      targetAverageValue: 10000
    type: Pods
</code></pre>
