How to get RabbitMQ metrics for horizontal pod autoscaling?

3/18/2019

I'm running GKE Kubernetes cluster v11.3 and trying to use RabbitMQ metrics for HPA. I do see RabbitMQ metrics:

 kubectl get --raw "/apis/custom.metrics.k8s.io/v1beta1" | jq| grep rabbit
      "name": "*/agent.googleapis.com|rabbitmq|num_messages",

But cannot use them in HorizontalPodAutoscaler:

ScalingActive  False   FailedGetPodsMetric  the HPA was unable to compute the replica count: unable to get metric rabbitmq|num_messages: unable to fetch metrics from custom metrics API: the server could not find the descriptor for metric rabbitmq/num_messages: googleapi: Error 404: Could not find descriptor for metric 'rabbitmq/num_messages'., notFound

Metric configuration:

metrics:
  - type: External
    external:
      metricName: custom.googleapis.com|rabbitmq|num_messages

What I'm missing?

-- Vitaly
autoscaling
kubernetes

0 Answers