<p>I am very new to both Kubernetes and RabbitMQ, but I am attempting to autoscale pods based on the number of ready messages in my RabbitMQ queue.</p>
<p>I have been following the GCP documentation <a href="https://cloud.google.com/kubernetes-engine/docs/tutorials/autoscaling-metrics#custom-prometheus" rel="nofollow noreferrer">here</a> and my prometheus rabbitmq container is based on the one found <a href="https://itnext.io/kubernetes-workers-autoscaling-based-on-rabbitmq-queue-size-cb0803193cdf" rel="nofollow noreferrer">here</a></p>
<p>From these guides I have created a deployment</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    run: rabbitmq-prometheus-sd
  name: rabbitmq-prometheus-sd
  namespace: default
spec:
  replicas: 1
  selector:
    matchLabels:
      run: rabbitmq-prometheus-sd
  template:
    metadata:
      labels:
        run: rabbitmq-prometheus-sd
    spec:
      containers:
      # rabbitmq-exporter container
      - name: prometheus
        image: kbudde/rabbitmq-exporter:v0.29.0
        env:
          - name: RABBIT_URL
            value: http://MYRABBITMQHOST.rmq.cloudamqp.com:15672
          - name: RABBIT_USER
            value: MYRABBITMQUSERNAME
          - name: RABBIT_PASSWORD
            value: MYRABBITMQPASSWORD
          - name: PUBLISH_PORT
            value: &quot;9419&quot;
          # amqp 3.6.9++
          - name: RABBIT_CAPABILITIES
            value: &quot;bert,no_sort&quot;
      # pre-built 'prometheus-to-sd' sidecar container to export prometheus
      # metrics to Stackdriver
      - name: prometheus-to-sd
        image: gcr.io/google-containers/prometheus-to-sd:v0.5.0
        command: [&quot;/monitor&quot;]
        args:
        - --source=:http://localhost:9419
        - --stackdriver-prefix=custom.googleapis.com
        - --pod-id=$(POD_ID)
        - --namespace-id=$(POD_NAMESPACE)
        env:
        # save Kubernetes metadata as environment variables for use in metrics
        - name: POD_ID
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.uid
        - name: POD_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
</code></pre>
<p>I am able to deploy this to my cluster in GKE, however when I check the custom metrics in the metric explorer I can only find these 3 and none others:</p>
<ul>
<li>rabbitmq_exporter_build_info</li>
<li>rabbitmq_module_up</li>
<li>rabbitmq_up</li>
</ul>
<p>Obviously without the queue metrics I cannot create a HPA to scale my application. Any help or guidance on why these metrics are not being delivered or suggested alternate routes would be appreciated.</p>

<p>The issue was that the rabbitmq exporter does not work with rabbitmq hosted on cloudampq. This <a href="https://medium.com/@prashant.vats/kubernetes-pod-autoscaling-in-response-to-the-change-in-the-rabbitmq-queue-3048b02413ef" rel="nofollow noreferrer">method</a> to scale was used instead</p>
