<p>I am not able to fetch items by running this command: <code>kubectl get --raw &quot;/apis/external.metrics.k8s.io/v1beta1/namespaces/default/rabbitmq_queue_messages_ready&quot; | jq</code></p>
<p>As you can see in below output items is an empty array:</p>
<pre><code>{
  &quot;kind&quot;: &quot;ExternalMetricValueList&quot;,
  &quot;apiVersion&quot;: &quot;external.metrics.k8s.io/v1beta1&quot;,
  &quot;metadata&quot;: {
    &quot;selfLink&quot;: &quot;/apis/external.metrics.k8s.io/v1beta1/namespaces/default/rabbitmq_queue_messages_ready&quot;
  },
  &quot;items&quot;: []
}
</code></pre>
<p>However, I am getting proper data in prometheus endpoint:
Prometheus URL: http://&lt;prometheus_url&gt;:9090/api/v1/series?match%5B%5D=%7B__name__%3D~%22%5Erabbitmq_queue_.%2A%22%7D&amp;start=1597255421.51
Response:</p>
<pre><code>{
&quot;status&quot;:&quot;success&quot;,
&quot;data&quot;:[
    {
        &quot;__name__&quot;:&quot;rabbitmq_queue_messages_ready&quot;,
        &quot;app&quot;:&quot;prometheus-rabbitmq-exporter&quot;,
        &quot;durable&quot;:&quot;true&quot;,
        &quot;instance&quot;:&quot;10.2.0.73:9419&quot;,
        &quot;job&quot;:&quot;kubernetes-pods&quot;,
        &quot;namespace&quot;:&quot;default&quot;,
        &quot;pod_name&quot;:&quot;rabbitmq-exporter-prometheus-rabbitmq-exporter-754c845847-gzlrq&quot;,
        &quot;pod_template_hash&quot;:&quot;754c845847&quot;,
        &quot;queue&quot;:&quot;test&quot;,
        &quot;release&quot;:&quot;rabbitmq-exporter&quot;,
        &quot;vhost&quot;:&quot;/&quot;
    },
    {
        &quot;__name__&quot;:&quot;rabbitmq_queue_messages_ready&quot;,
        &quot;app&quot;:&quot;prometheus-rabbitmq-exporter&quot;,
        &quot;durable&quot;:&quot;true&quot;,
        &quot;instance&quot;:&quot;10.2.0.73:9419&quot;,
        &quot;job&quot;:&quot;kubernetes-pods&quot;,
        &quot;namespace&quot;:&quot;default&quot;,
        &quot;pod_name&quot;:&quot;rabbitmq-exporter-prometheus-rabbitmq-exporter-754c845847-gzlrq&quot;,
        &quot;pod_template_hash&quot;:&quot;754c845847&quot;,
        &quot;queue&quot;:&quot;test1&quot;,
        &quot;release&quot;:&quot;rabbitmq-exporter&quot;,
        &quot;vhost&quot;:&quot;/&quot;
    }
]
}
</code></pre>
<p>I installed <code>stable/prometheus-adapter</code> using below helm values:</p>
<pre><code>rules:
  default: false
  external:
    - seriesQuery: '{__name__=~&quot;^rabbitmq_queue_.*&quot;}'
      resources:
        #template: &lt;&lt;.Resource&gt;&gt;
        overrides:
          namespace:
            resource: namespace
          service:
            resource: service
          pod:
            resource: pod
      name:
        matches: &quot;&quot;
        as: &quot;rabbitmq_queue_messages_ready&quot;
      metricsQuery: 'rate(&lt;&lt;.Series&gt;&gt;{&lt;&lt;.LabelMatchers&gt;&gt;}[1m])'
</code></pre>
<p><strong>Version of Helm and Kubernetes</strong>:</p>
<p>Client: &amp;version.Version{SemVer:&quot;v2.16.9&quot;, GitCommit:&quot;8ad7037828e5a0fca1009dabe290130da6368e39&quot;, GitTreeState:&quot;clean&quot;}
Server: &amp;version.Version{SemVer:&quot;v2.16.7&quot;, GitCommit:&quot;5f2584fd3d35552c4af26036f0c464191287986b&quot;, GitTreeState:&quot;clean&quot;}</p>
<p>Client Version: version.Info{Major:&quot;1&quot;, Minor:&quot;16&quot;, GitVersion:&quot;v1.16.1&quot;, GitCommit:&quot;d647ddbd755faf07169599a625faf302ffc34458&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2019-10-02T17:01:15Z&quot;, GoVersion:&quot;go1.12.10&quot;, Compiler:&quot;gc&quot;, Platform:&quot;darwin/amd64&quot;}
Server Version: version.Info{Major:&quot;1&quot;, Minor:&quot;15&quot;, GitVersion:&quot;v1.15.11&quot;, GitCommit:&quot;ec831747a3a5896dbdf53f259eafea2a2595217c&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2020-05-29T19:56:10Z&quot;, GoVersion:&quot;go1.12.17&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}</p>
<p><strong>Expected result</strong>:
It should fetch metrics from Prometheus</p>
<p><strong>How to reproduce it</strong>:
Install <code>stable/prometheus-rabbitmq-exporter</code> and <code>stable/prometheus-adapter</code> helm charts using above configs.</p>
<p>I am following this guide: <a href="https://nuvalence.io/building-a-k8s-autoscaler-with-custom-metrics/" rel="nofollow noreferrer">https://nuvalence.io/building-a-k8s-autoscaler-with-custom-metrics/</a></p>

<p>To troubleshoot your issue further at first place I would check a couple of things in your prom-adapter setup:</p>
<ol>
<li>Do you see any errors in Prometheus adapter logs while getting metrics directly with <code>&quot;kubectl get --raw ...&quot;</code> command ?</li>
<li>To which namespace you have installed your <code>prometheus-adapter</code> ? (asking because I used to observe RBAC related errors in adapter logs when deployed to another ns than 'kube-system')</li>
<li>Can you please paste the content of your final 'prom-adapter' <code>/etc/adapter/config.yaml</code> config (from prom-adapter's Pod)</li>
</ol>
<p>I'm exposing the same external rabbitmq metrics with the adapter without any problems, check output from the same command:</p>
<pre><code>{
  &quot;kind&quot;: &quot;ExternalMetricValueList&quot;,
  &quot;apiVersion&quot;: &quot;external.metrics.k8s.io/v1beta1&quot;,
  &quot;metadata&quot;: {
    &quot;selfLink&quot;: &quot;/apis/external.metrics.k8s.io/v1beta1/namespaces/default/rabbitmq_queue_messages_ready&quot;
  },
  &quot;items&quot;: [
    {
      &quot;metricName&quot;: &quot;rabbitmq_queue_messages_ready&quot;,
      &quot;metricLabels&quot;: {
        &quot;endpoint&quot;: &quot;metrics&quot;,
        &quot;instance&quot;: &quot;10.64.1.97:9419&quot;,
        &quot;job&quot;: &quot;rabbitmq&quot;,
        &quot;namespace&quot;: &quot;default&quot;,
        &quot;pod&quot;: &quot;rabbitmq-0&quot;,
        &quot;service&quot;: &quot;rabbitmq&quot;
      },
      &quot;timestamp&quot;: &quot;2020-08-13T23:50:29Z&quot;,
      &quot;value&quot;: &quot;174160m&quot;
    }
  ]
}
</code></pre>
<p><strong>Used prom-adapter version</strong>: <code>directxman12/k8s-prometheus-adapter-amd64:v0.6.0</code></p>
<p>//Using Community wiki post for better clarity (code snippets formatting, etc.)</p>
