Skip to content

Error when I connect telegraf to 3rd party RabbitMQ. Unnecessary condition for Listeners #9300

@Levarix

Description

@Levarix

I have access to RabbitMQ from 3rd party and I guess not full. It's important to monitor queues to which I have access, but when I connect telegraf to the cluster I'm getting Wrong answer from rabbitmq. Probably auth issue error which is problematic because we monitor any error with it.

Condition:

if overview.QueueTotals == nil || overview.ObjectTotals == nil || overview.MessageStats == nil || overview.Listeners == nil {
acc.AddError(fmt.Errorf("Wrong answer from rabbitmq. Probably auth issue"))
return
}

As you can see from my snippet of JSON file from api/overview I don't have in it Listeners so conditional is true and the plugin writes in my output the error. I think it's an unnecessary condition for Listeners or maybe you can add an option in the plugin configuration for skipping it.

{
  "management_version": "3.8.5",
  "rates_mode": "basic",
  "sample_retention_policies": {
    "global": [
      600,
      3600,
      28800,
      86400
    ],
    "basic": [
      600,
      3600
    ],
    "detailed": [
      600
    ]
  },
  "exchange_types": [
    {
      "name": "direct",
      "description": "AMQP direct exchange, as per the AMQP specification",
      "enabled": true
    },
    {
      "name": "fanout",
      "description": "AMQP fanout exchange, as per the AMQP specification",
      "enabled": true
    },
    {
      "name": "headers",
      "description": "AMQP headers exchange, as per the AMQP specification",
      "enabled": true
    },
    {
      "name": "topic",
      "description": "AMQP topic exchange, as per the AMQP specification",
      "enabled": true
    },
    {
      "name": "x-consistent-hash",
      "description": "Consistent Hashing Exchange",
      "enabled": true
    },
    {
      "name": "x-federation-upstream",
      "description": "Federation upstream helper exchange",
      "internal_purpose": "federation",
      "enabled": true
    }
  ],
  "product_version": "3.8.5",
  "product_name": "RabbitMQ",
  "rabbitmq_version": "3.8.5",
  "cluster_name": "<sensitive>",
  "erlang_version": "23.1",
  "erlang_full_version": "Erlang/OTP 23 [erts-11.1] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:64]",
  "disable_stats": false,
  "enable_queue_totals": false,
  "message_stats": {
    "ack": 52335,
    "ack_details": {
      "rate": 0.0
    },
    "confirm": 0,
    "confirm_details": {
      "rate": 0.0
    },
    "deliver": 54947,
    "deliver_details": {
      "rate": 0.0
    },
    "deliver_get": 54947,
    "deliver_get_details": {
      "rate": 0.0
    },
    "deliver_no_ack": 0,
    "deliver_no_ack_details": {
      "rate": 0.0
    },
    "disk_reads": 5992,
    "disk_reads_details": {
      "rate": 0.0
    },
    "disk_writes": 78112,
    "disk_writes_details": {
      "rate": 0.0
    },
    "drop_unroutable": 0,
    "drop_unroutable_details": {
      "rate": 0.0
    },
    "get": 0,
    "get_details": {
      "rate": 0.0
    },
    "get_empty": 0,
    "get_empty_details": {
      "rate": 0.0
    },
    "get_no_ack": 0,
    "get_no_ack_details": {
      "rate": 0.0
    },
    "publish": 6627,
    "publish_details": {
      "rate": 0.0
    },
    "redeliver": 3,
    "redeliver_details": {
      "rate": 0.0
    },
    "return_unroutable": 0,
    "return_unroutable_details": {
      "rate": 0.0
    }
  },
  "churn_rates": {
    "channel_closed": 262895,
    "channel_closed_details": {
      "rate": 0.0
    },
    "channel_created": 263045,
    "channel_created_details": {
      "rate": 0.0
    },
    "connection_closed": 162401,
    "connection_closed_details": {
      "rate": 0.0
    },
    "connection_created": 53318,
    "connection_created_details": {
      "rate": 0.0
    },
    "queue_created": 3447,
    "queue_created_details": {
      "rate": 0.0
    },
    "queue_declared": 76230,
    "queue_declared_details": {
      "rate": 0.0
    },
    "queue_deleted": 3267,
    "queue_deleted_details": {
      "rate": 0.0
    }
  },
  "queue_totals": {
    "messages": 1045,
    "messages_details": {
      "rate": 0.0
    },
    "messages_ready": 1045,
    "messages_ready_details": {
      "rate": 0.0
    },
    "messages_unacknowledged": 0,
    "messages_unacknowledged_details": {
      "rate": 0.0
    }
  },
  "object_totals": {
    "channels": 49,
    "connections": 17,
    "exchanges": 10,
    "queues": 34
  },
  "statistics_db_event_queue": 0
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions