Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

missing queue_max_length metric (policy limits) #238

Closed
devops-verci opened this issue Nov 27, 2021 · 7 comments
Closed

missing queue_max_length metric (policy limits) #238

devops-verci opened this issue Nov 27, 2021 · 7 comments

Comments

@devops-verci
Copy link

hello
iam using this config:
{ "rabbit_url": "http://127.0.0.1:15672", "rabbit_user": "exporter", "rabbit_pass": "exporter", "publish_port": "9419", "publish_addr": "", "output_format": "TTY", "insecure_skip_verify": true, "exlude_metrics": [], "include_queues": ".*", "skip_queues": "^$", "skip_vhost": "^$", "include_vhost": ".*", "rabbit_capabilities": "no_sort,bert", "enabled_exporters": [ "exchange", "node", "overview", "queue", "cluster" ], "timeout": 30, "max_queues": 0 }
and there is no queue_max_length metric.. why is that?
thank you

@kbudde
Copy link
Owner

kbudde commented Dec 11, 2021

HI @devops-verci,

The configuration looks ok. I suspect you have all the other queue metrics (like queue_message_bytes)?
You also have to apply the a policy to the queue (https://www.rabbitmq.com/maxlength.html).

You should see the limits inside rabbitmq management interface per queue. If the limits are visible there, they should be included in the metrics.

You can check the api yourself (rabbit/api/queues). There you should find x-max-length setting.

  {
    "arguments": {
      "x-max-length": 123,
      "x-max-length-bytes": 1024,
      "x-queue-type": "classic"
    },
    "auto_delete": false,
    "backing_queue_status": {
      "avg_ack_egress_rate": 0,
      "avg_ack_ingress_rate": 0,
      "avg_egress_rate": 0,
      "avg_ingress_rate": 0,
      "delta": [
        "delta",
        "undefined",
        0,
        0,
        "undefined"
      ],
      "len": 0,
      "mode": "default",
      "next_seq_id": 0,
      "q1": 0,
      "q2": 0,
      "q3": 0,
      "q4": 0,
      "target_ram_count": "infinity"
    },
    "consumer_capacity": 0,
    "consumer_utilisation": 0,
    "consumers": 0,
    "durable": true,
    "effective_policy_definition": {},
    "exclusive": false,
    "exclusive_consumer_tag": null,
    "garbage_collection": {
      "fullsweep_after": 65535,
      "max_heap_size": 0,
      "min_bin_vheap_size": 46422,
      "min_heap_size": 233,
      "minor_gcs": 1
    },
    "head_message_timestamp": null,
    "idle_since": "2021-12-11 18:00:28",
    "memory": 13952,
    "message_bytes": 0,
    "message_bytes_paged_out": 0,
    "message_bytes_persistent": 0,
    "message_bytes_ram": 0,
    "message_bytes_ready": 0,
    "message_bytes_unacknowledged": 0,
    "messages": 0,
    "messages_details": {
      "rate": 0
    },
    "messages_paged_out": 0,
    "messages_persistent": 0,
    "messages_ram": 0,
    "messages_ready": 0,
    "messages_ready_details": {
      "rate": 0
    },
    "messages_ready_ram": 0,
    "messages_unacknowledged": 0,
    "messages_unacknowledged_details": {
      "rate": 0
    },
    "messages_unacknowledged_ram": 0,
    "name": "test_with_limits",
    "node": "rabbit@9d7a086adb9d",
    "operator_policy": null,
    "policy": null,
    "recoverable_slaves": null,
    "reductions": 5901,
    "reductions_details": {
      "rate": 0
    },
    "single_active_consumer_tag": null,
    "state": "running",
    "type": "classic",
    "vhost": "/"
  },
  {
    "arguments": {
      "x-queue-type": "classic"
    },
    "auto_delete": false,
    "backing_queue_status": {
      "avg_ack_egress_rate": 0,
      "avg_ack_ingress_rate": 0,
      "avg_egress_rate": 0,
      "avg_ingress_rate": 0,
      "delta": [
        "delta",
        "undefined",
        0,
        0,
        "undefined"
      ],
      "len": 0,
      "mode": "default",
      "next_seq_id": 0,
      "q1": 0,
      "q2": 0,
      "q3": 0,
      "q4": 0,
      "target_ram_count": "infinity"
    },
    "consumer_capacity": 0,
    "consumer_utilisation": 0,
    "consumers": 0,
    "durable": true,
    "effective_policy_definition": {},
    "exclusive": false,
    "exclusive_consumer_tag": null,
    "garbage_collection": {
      "fullsweep_after": 65535,
      "max_heap_size": 0,
      "min_bin_vheap_size": 46422,
      "min_heap_size": 233,
      "minor_gcs": 7
    },
    "head_message_timestamp": null,
    "idle_since": "2021-12-11 18:00:03",
    "memory": 13792,
    "message_bytes": 0,
    "message_bytes_paged_out": 0,
    "message_bytes_persistent": 0,
    "message_bytes_ram": 0,
    "message_bytes_ready": 0,
    "message_bytes_unacknowledged": 0,
    "messages": 0,
    "messages_details": {
      "rate": 0
    },
    "messages_paged_out": 0,
    "messages_persistent": 0,
    "messages_ram": 0,
    "messages_ready": 0,
    "messages_ready_details": {
      "rate": 0
    },
    "messages_ready_ram": 0,
    "messages_unacknowledged": 0,
    "messages_unacknowledged_details": {
      "rate": 0
    },
    "messages_unacknowledged_ram": 0,
    "name": "test_without_policy",
    "node": "rabbit@9d7a086adb9d",
    "operator_policy": null,
    "policy": null,
    "recoverable_slaves": null,
    "reductions": 5666,
    "reductions_details": {
      "rate": 0
    },
    "single_active_consumer_tag": null,
    "state": "running",
    "type": "classic",
    "vhost": "/"
  }
]```

@devops-verci
Copy link
Author

ive checked our rabbitmq, it looks like this:

  "consumer_capacity": 0,
  "consumer_utilisation": 0,
  "consumers": 0,
  "deliveries": [],
  "durable": true,
  "effective_policy_definition": {
    "max-length": 20000
  },
  "exclusive": false,

so we have max-length, but format not same as yours...

@kbudde
Copy link
Owner

kbudde commented Dec 12, 2021

Interesting. Which rabbitMQ version is it?

@devops-verci
Copy link
Author

rabbitmq_build_info{erlang_version="24.0.5", instance=":15692", job="rabbitMQ", 
prometheus_client_version="4.8.1", prometheus_plugin_version="3.9.5", rabbitmq_version="3.9.5"}

@kbudde
Copy link
Owner

kbudde commented Dec 12, 2021

@devops-verci Thank you for the information.
The problem is much simpler: At the moment this exporter only exports the limits if they are supplied as arguments while creating the queue. Limits assigned through policies are not processed at all.
I will create an improved version the next days which will expose the effective limit (if a limit is set on queue creation and through policy, the lower limit is applied).

@kbudde kbudde changed the title missing queue_max_length metric missing queue_max_length metric (policy limits) Dec 12, 2021
kbudde added a commit that referenced this issue Dec 13, 2021
@kbudde
Copy link
Owner

kbudde commented Dec 13, 2021

Hi,

@devops-verci can you please verify the latest version. It should provide the limits you are looking for.

@devops-verci
Copy link
Author

thank you so much, metrics appeared.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants