# Rabbitmq plugin field problem

**URL:** https://discuss.elastic.co/t/rabbitmq-plugin-field-problem/162922
**Category:** Beats
**Tags:** metricbeat
**Created:** [January 4, 2019, 9:40am UTC](https://discuss.elastic.co/t/rabbitmq-plugin-field-problem/162922 "2019-01-04T09:40:17Z")
**Posts on this page:** 17
**Page:** 1

<div class="post-metadata">

### Author: ![Izek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/izek/32/37113_2.png) [@Izek](https://discuss.elastic.co/u/Izek)
#### Post date: [January 4, 2019, 9:40am UTC](https://discuss.elastic.co/t/rabbitmq-plugin-field-problem/162922/1 "2019-01-04T09:40:17Z")

</div>

I saw the document about rabbitmq plugin and there is field "rabbitmq.exchange.messages".  
But in my metricbeat with version 6.5.4-1, these fields still missing.  
What version will have this field added?

[elastic rabbitmq plugin document](https://www.elastic.co/guide/en/beats/metricbeat/6.5/_rabbitmq_exchange_metricset.html)

---

<div class="post-metadata">

### Author: ![Kaiyan\_Sheng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kaiyan_sheng/32/38247_2.png) [@Kaiyan\_Sheng](https://discuss.elastic.co/u/Kaiyan_Sheng)
#### Post date: [January 4, 2019, 6:40pm UTC](https://discuss.elastic.co/t/rabbitmq-plugin-field-problem/162922/2 "2019-01-04T18:40:44Z")

</div>

Hi @Izek, thanks for posting your question here. 6.5.4 should support the `rabbitmq.exchange.messages` metrics. Do you have `exchange` metricset enabled in the rabbitmq config file?

---

<div class="post-metadata">

### Author: ![Izek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/izek/32/37113_2.png) [@Izek](https://discuss.elastic.co/u/Izek)
#### Post date: [January 4, 2019, 11:46pm UTC](https://discuss.elastic.co/t/rabbitmq-plugin-field-problem/162922/3 "2019-01-04T23:46:00Z")

</div>

Hi @Kaiyan_Sheng

Here is the document detail

```json
"rabbitmq": {
        "exchange": {
            "arguments": {},
            "auto_delete": false,
            "durable": true,
            "internal": false,
            "messages": {
                "ack": {},
                "confirm": {},
                "deliver_get": {},
                "publish": {},
                "publish_in": {
                    "count": 607,
                    "details": {
                        "rate": 4
                    }
                },
                "publish_out": {
                    "count": 547,
                    "details": {
                        "rate": 4
                    }
                },
                "redeliver": {},
                "return_unroutable": {}
            },
            "name": "",
            "type": "direct",
            "user": "rmq-internal",
            "vhost": "/"
        }
    } 

```

And below is from metricbeat module test

```json
  exchange...OK
    result:
    {
     "@timestamp": "2019-01-04T23:43:23.839Z",
     "metricset": {
      "host": "localhost:15672",
      "module": "rabbitmq",
      "name": "exchange",
      "rtt": 3840
     },
     "rabbitmq": {
      "exchange": {
       "arguments": {},
       "auto_delete": false,
       "durable": true,
       "internal": false,
       "name": "",
       "type": "direct",
       "vhost": "/"
      }
     }
    }

```

The message part is missing.  
Also I cannot find those missing field in the field.yml file.

---

<div class="post-metadata">

### Author: ![Kaiyan\_Sheng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kaiyan_sheng/32/38247_2.png) [@Kaiyan\_Sheng](https://discuss.elastic.co/u/Kaiyan_Sheng)
#### Post date: [January 6, 2019, 9:59pm UTC](https://discuss.elastic.co/t/rabbitmq-plugin-field-problem/162922/4 "2019-01-06T21:59:11Z")

</div>

Thanks for the details. Can you check the metricbeat config file includes a similar part like this:

```auto
metricbeat.modules:
- module: rabbitmq
  metricsets: ["exchange"]

```

Please see [https://www.elastic.co/guide/en/beats/metricbeat/current/configuration-metricbeat.html](https://www.elastic.co/guide/en/beats/metricbeat/current/configuration-metricbeat.html) for more details.

---

<div class="post-metadata">

### Author: ![Izek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/izek/32/37113_2.png) [@Izek](https://discuss.elastic.co/u/Izek)
#### Post date: [January 7, 2019, 1:38am UTC](https://discuss.elastic.co/t/rabbitmq-plugin-field-problem/162922/5 "2019-01-07T01:38:06Z")

</div>

Here is my config.

```json
- module: rabbitmq
  metricsets: ["node", "queue", "connection", "exchange"]
  enabled: true
  period: 60s
  hosts: ["http://test:15672"]
  username: test
  password: test

- module: rabbitmq
  metricsets: ["node", "queue", "connection", "exchange"]
  enabled: true
  period: 60s
  #hosts: ["http://localhost:15672"]
  hosts: ["http://localhost:15672"]
  username: test
  password: test

```

And I only have these much field in the index related to exchange

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/d/6daaf8f9806e36c19bf93551fa657a327b0b6d9f.png)

---

<div class="post-metadata">

### Author: ![Izek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/izek/32/37113_2.png) [@Izek](https://discuss.elastic.co/u/Izek)
#### Post date: [January 10, 2019, 2:33am UTC](https://discuss.elastic.co/t/rabbitmq-plugin-field-problem/162922/6 "2019-01-10T02:33:53Z")

</div>

Hi @Kaiyan_Sheng,

Do you find anything about this?  
Or is it a bug need to be fixed

---

<div class="post-metadata">

### Author: ![Kaiyan\_Sheng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kaiyan_sheng/32/38247_2.png) [@Kaiyan\_Sheng](https://discuss.elastic.co/u/Kaiyan_Sheng)
#### Post date: [January 10, 2019, 4:30am UTC](https://discuss.elastic.co/t/rabbitmq-plugin-field-problem/162922/7 "2019-01-10T04:30:22Z")

</div>

@Izek Hello! Sorry for the late response! I'm confused by the question now 🙂 So you do see metrics from rabbitmq exchange metricset. That's good! So are you saying there are `rabbitmq.exchange.messages.*` metrics missing then?

---

<div class="post-metadata">

### Author: ![Izek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/izek/32/37113_2.png) [@Izek](https://discuss.elastic.co/u/Izek)
#### Post date: [January 10, 2019, 5:37am UTC](https://discuss.elastic.co/t/rabbitmq-plugin-field-problem/162922/8 "2019-01-10T05:37:05Z")

</div>

> [@Izek](#):
>
> "messages": { "ack": {}, "confirm": {}, "deliver\_get": {}, "publish": {}, "publish\_in": { "count": 607, "details": { "rate": 4 } }, "publish\_out": { "count": 547, "details": { "rate": 4 } }, "redeliver": {}, "return\_unroutable": {} }

Yes, for all the fields like ack, confirm, deliver\_get are missing.  
I try to query rabbitmq API directly and I can see the data there.

---

<div class="post-metadata">

### Author: ![Kaiyan\_Sheng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kaiyan_sheng/32/38247_2.png) [@Kaiyan\_Sheng](https://discuss.elastic.co/u/Kaiyan_Sheng)
#### Post date: [January 10, 2019, 5:47am UTC](https://discuss.elastic.co/t/rabbitmq-plugin-field-problem/162922/9 "2019-01-10T05:47:57Z")

</div>

@Izek Yes ok now I see your question! Thanks for explaining it to me. I do have some suspicions on the rabbitmq exchange metricset schema might cause this problem. I will verify it and get back to you tomorrow! Thanks again!

---

<div class="post-metadata">

### Author: ![Kaiyan\_Sheng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kaiyan_sheng/32/38247_2.png) [@Kaiyan\_Sheng](https://discuss.elastic.co/u/Kaiyan_Sheng)
#### Post date: [January 10, 2019, 10:29pm UTC](https://discuss.elastic.co/t/rabbitmq-plugin-field-problem/162922/10 "2019-01-10T22:29:20Z")

</div>

@Izek Can you show us exactly which rabbitmq api query did you use here? @jsoriano When you get a chance, can you take a look at this issue please? Thanks!

---

<div class="post-metadata">

### Author: ![Izek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/izek/32/37113_2.png) [@Izek](https://discuss.elastic.co/u/Izek)
#### Post date: [January 11, 2019, 2:47am UTC](https://discuss.elastic.co/t/rabbitmq-plugin-field-problem/162922/11 "2019-01-11T02:47:12Z")

</div>

I use this one "[http://localhost:15672/api/exchanges](http://localhost:15672/api/exchanges)".  
RabbitMQ version is 3.6.5 and 3.6.15  
The data inside message\_stats is what I need

```json
[{
	"name": "",
	"vhost": "/",
	"type": "direct",
	"durable": true,
	"auto_delete": false,
	"internal": false,
	"arguments": {}
}, {
	"name": "amq.direct",
	"vhost": "/",
	"type": "direct",
	"durable": true,
	"auto_delete": false,
	"internal": false,
	"arguments": {}
}, {
	"name": "amq.fanout",
	"vhost": "/",
	"type": "fanout",
	"durable": true,
	"auto_delete": false,
	"internal": false,
	"arguments": {}
}, {
	"name": "amq.headers",
	"vhost": "/",
	"type": "headers",
	"durable": true,
	"auto_delete": false,
	"internal": false,
	"arguments": {}
}, {
	"name": "amq.match",
	"vhost": "/",
	"type": "headers",
	"durable": true,
	"auto_delete": false,
	"internal": false,
	"arguments": {}
}, {
	"name": "amq.rabbitmq.log",
	"vhost": "/",
	"type": "topic",
	"durable": true,
	"auto_delete": false,
	"internal": true,
	"arguments": {}
}, {
	"name": "amq.rabbitmq.trace",
	"vhost": "/",
	"type": "topic",
	"durable": true,
	"auto_delete": false,
	"internal": true,
	"arguments": {}
}, {
	"name": "amq.topic",
	"vhost": "/",
	"type": "topic",
	"durable": true,
	"auto_delete": false,
	"internal": false,
	"arguments": {}
}, {
	"name": "",
	"vhost": "clusterSvcHost",
	"type": "direct",
	"durable": true,
	"auto_delete": false,
	"internal": false,
	"arguments": {},
	"policy": "ha-clustersvc"
}, {
	"name": "amq.direct",
	"vhost": "clusterSvcHost",
	"type": "direct",
	"durable": true,
	"auto_delete": false,
	"internal": false,
	"arguments": {},
	"policy": "ha-clustersvc"
}, {
	"name": "amq.fanout",
	"vhost": "clusterSvcHost",
	"type": "fanout",
	"durable": true,
	"auto_delete": false,
	"internal": false,
	"arguments": {},
	"policy": "ha-clustersvc"
}, {
	"name": "amq.headers",
	"vhost": "clusterSvcHost",
	"type": "headers",
	"durable": true,
	"auto_delete": false,
	"internal": false,
	"arguments": {},
	"policy": "ha-clustersvc"
}, {
	"name": "amq.match",
	"vhost": "clusterSvcHost",
	"type": "headers",
	"durable": true,
	"auto_delete": false,
	"internal": false,
	"arguments": {},
	"policy": "ha-clustersvc"
}, {
	"name": "amq.rabbitmq.trace",
	"vhost": "clusterSvcHost",
	"type": "topic",
	"durable": true,
	"auto_delete": false,
	"internal": true,
	"arguments": {},
	"policy": "ha-clustersvc"
}, {
	"message_stats": {
		"publish": 0,
		"publish_details": {
			"rate": 0.0
		},
		"publish_in": 2317414549,
		"publish_in_details": {
			"rate": 426.0
		},
		"publish_out": 5595401900,
		"publish_out_details": {
			"rate": 1069.6
		},
		"ack": 0,
		"ack_details": {
			"rate": 0.0
		},
		"deliver_get": 0,
		"deliver_get_details": {
			"rate": 0.0
		},
		"confirm": 0,
		"confirm_details": {
			"rate": 0.0
		},
		"return_unroutable": 0,
		"return_unroutable_details": {
			"rate": 0.0
		},
		"redeliver": 0,
		"redeliver_details": {
			"rate": 0.0
		}
	},
	"name": "amq.topic",
	"vhost": "clusterSvcHost",
	"type": "topic",
	"durable": true,
	"auto_delete": false,
	"internal": false,
	"arguments": {},
	"policy": "ha-clustersvc"
}]

```

---

<div class="post-metadata">

### Author: ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)
#### Post date: [January 11, 2019, 1:01pm UTC](https://discuss.elastic.co/t/rabbitmq-plugin-field-problem/162922/12 "2019-01-11T13:01:31Z")

</div>

Hi @Izek,

There are some things that can create confusion here.

First, the document you mention from the config. I have tried to reproduce it and with current code this actually only contains `publish_in` and `publish_out` fields. The one in the repository may have been generated with an old or in development version of the code.

Also, note that Metricbeat is tested with rabbitmq 5.7, even if the stats seem to follow the same format, there can be some differences, we'd have to check.

Another point is that the `message_stats` object is commonly used by rabbitmq management interface to collect stats of different kinds of objects, but not all objects use all fields (exchanges don't have the same metrics as queues, but internally they use the same object for stats). Metricbeat only collects the metrics that are meaningful for each kind of object, so we don't store loads of zero metrics.  
This is an opinionated behaviour and is prone to missing fields, we can review the decissions here if we see some object reporting non-zero metrics for some field we are not collecting.

Now, for the case you mention, actually you have an exchange with non-zero values in `publish_in` and `publish_out` metrics, this should have been collected. Are you using the same user in metricbeat and in the query to the API? Different users can have different visibility. You may also need to configure the vhost.

It is also weird that the event that is being collected with `module test` has an exchange with an empty name, we may be incorrectly handling some error.

I will open an issue as follow up of this, at least to regenerate the example data and to check support of Rabbitmq 3.6.

---

<div class="post-metadata">

### Author: ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)
#### Post date: [January 11, 2019, 1:14pm UTC](https://discuss.elastic.co/t/rabbitmq-plugin-field-problem/162922/13 "2019-01-11T13:14:25Z")

</div>

Issue created for follow up actions [https://github.com/elastic/beats/issues/10014](https://github.com/elastic/beats/issues/10014)

Please keep the discussion here and we'll update the issue with more actions if needed.

---

<div class="post-metadata">

### Author: ![Izek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/izek/32/37113_2.png) [@Izek](https://discuss.elastic.co/u/Izek)
#### Post date: [January 12, 2019, 2:22am UTC](https://discuss.elastic.co/t/rabbitmq-plugin-field-problem/162922/14 "2019-01-12T02:22:20Z")

</div>

Hi @jsoriano,

I use same user wherever query api or in metricbeat.  
And yes, the publish\_in and publish\_out are successfully collected.  
I will try to use admin account to do the test again to see there have any different or not.

---

<div class="post-metadata">

### Author: ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)
#### Post date: [January 12, 2019, 3:13pm UTC](https://discuss.elastic.co/t/rabbitmq-plugin-field-problem/162922/15 "2019-01-12T15:13:54Z")

</div>

> [@Izek](#):
>
> And yes, the publish\_in and publish\_out are successfully collected.

Do you mean that these fields are successfully collected by metricbeat? AFAIK these are all the stats that can be collected from exchanges, so it'd be the expected behaviour.

Do you know of some scenario in which more (non-zero) metrics are reported for exchanges?

---

<div class="post-metadata">

### Author: ![Izek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/izek/32/37113_2.png) [@Izek](https://discuss.elastic.co/u/Izek)
#### Post date: [January 12, 2019, 4:14pm UTC](https://discuss.elastic.co/t/rabbitmq-plugin-field-problem/162922/16 "2019-01-12T16:14:44Z")

</div>

Yes, but only these two field. nothing else.  
I also expect it can collect everything inside the message\_stats but there have no those fields in the field.yml file.  
I try to add it manually but not work.

And I try to hit the version 3.6.x API, for the other fields, not collect metric even it is non-zero.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [February 10, 2019, 4:03am UTC](https://discuss.elastic.co/t/rabbitmq-plugin-field-problem/162922/18 "2019-02-10T04:03:50Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
