Update rabbitmq input readme

This commit is contained in:
Daniel Nelson 2019-10-23 17:26:31 -07:00
parent 8b3a8d1113
commit 3770923ce3
No known key found for this signature in database
GPG Key ID: CAAD59C9444F6155
2 changed files with 159 additions and 162 deletions

View File

@ -7,7 +7,7 @@ For additional details reference the [RabbitMQ Management HTTP Stats][management
[management]: https://www.rabbitmq.com/management.html
[management-reference]: https://raw.githack.com/rabbitmq/rabbitmq-management/rabbitmq_v3_6_9/priv/www/api/index.html
### Configuration:
### Configuration
```toml
[[inputs.rabbitmq]]
@ -48,22 +48,25 @@ For additional details reference the [RabbitMQ Management HTTP Stats][management
## specified, metrics for all exchanges are gathered.
# exchanges = ["telegraf"]
## A list of federation upstreams to gather as the rabbitmq_federation measurement.
## If not specified, metrics for all federation upstreams are gathered.
## Federation link metrics will only be gathered for queues and exchanges
## whose non-federation metrics will be collected (e.g a queue excluded
## by the 'queue_name_exclude' option will also be excluded from federation).
# federation_upstreams = ["dataCentre2"]
## Queues to include and exclude. Globs accepted.
## Note that an empty array for both will include all queues
# queue_name_include = []
# queue_name_exclude = []
## Federation upstreams to include and exlude specified as an array of glob
## pattern strings. Federation links can also be limited by the queue and
## exchange filters.
# federation_upstream_include = []
# federation_upstream_exclude = []
```
### Measurements & Fields:
### Metrics
- rabbitmq_overview
- tags:
- url
- name
- fields:
- channels (int, channels)
- connections (int, connections)
- consumers (int, consumers)
@ -81,7 +84,12 @@ For additional details reference the [RabbitMQ Management HTTP Stats][management
- return_unroutable (int, number of unroutable messages)
- return_unroutable_rate (float, number of unroutable messages per second)
- rabbitmq_node
+ rabbitmq_node
- tags:
- url
- node
- url
- fields:
- disk_free (int, bytes)
- disk_free_limit (int, bytes)
- disk_free_alarm (int, disk alarm)
@ -136,6 +144,14 @@ For additional details reference the [RabbitMQ Management HTTP Stats][management
- mem_total (int, bytes)
- rabbitmq_queue
- tags:
- url
- queue
- vhost
- node
- durable
- auto_delete
- fields:
- consumer_utilisation (float, percent)
- consumers (int, int)
- idle_since (string, time - e.g., "2006-01-02 15:04:05")
@ -159,13 +175,32 @@ For additional details reference the [RabbitMQ Management HTTP Stats][management
- messages_redeliver_rate (float, messages per second)
- messages_unack (integer, count)
- rabbitmq_exchange
+ rabbitmq_exchange
- tags:
- url
- exchange
- type
- vhost
- internal
- durable
- auto_delete
- fields:
- messages_publish_in (int, count)
- messages_publish_in_rate (int, messages per second)
- messages_publish_out (int, count)
- messages_publish_out_rate (int, messages per second)
- rabbitmq_federation
- tags:
- url
- vhost
- type
- upstream
- exchange
- upstream_exchange
- queue
- upstream_queue
- fields:
- acks_uncommitted (int, count)
- consumers (int, count)
- messages_unacknowledged (int, count)
@ -175,53 +210,15 @@ For additional details reference the [RabbitMQ Management HTTP Stats][management
- messages_publish (int, count)
- messages_return_unroutable (int, count)
### Tags:
- All measurements have the following tags:
- url
- rabbitmq_overview
- name
- rabbitmq_node
- node
- url
- rabbitmq_queue
- url
- queue
- vhost
- node
- durable
- auto_delete
- rabbitmq_exchange
- url
- exchange
- type
- vhost
- internal
- durable
- auto_delete
- rabbitmq_federation
- url
- vhost
- type
- upstream
- local_entity
- upstream_entity
### Sample Queries:
### Sample Queries
Message rates for the entire node can be calculated from total message counts. For instance, to get the rate of messages published per minute, use this query:
```
SELECT NON_NEGATIVE_DERIVATIVE(LAST("messages_published"), 1m) AS messages_published_rate
FROM rabbitmq_overview WHERE time > now() - 10m GROUP BY time(1m)
SELECT NON_NEGATIVE_DERIVATIVE(LAST("messages_published"), 1m) AS messages_published_rate FROM rabbitmq_overview WHERE time > now() - 10m GROUP BY time(1m)
```
### Example Output:
### Example Output
```
rabbitmq_queue,url=http://amqp.example.org:15672,queue=telegraf,vhost=influxdb,node=rabbit@amqp.example.org,durable=true,auto_delete=false,host=amqp.example.org messages_deliver_get=0i,messages_publish=329i,messages_publish_rate=0.2,messages_redeliver_rate=0,message_bytes_ready=0i,message_bytes_unacked=0i,messages_deliver=329i,messages_unack=0i,consumers=1i,idle_since="",messages=0i,messages_deliver_rate=0.2,messages_deliver_get_rate=0.2,messages_redeliver=0i,memory=43032i,message_bytes_ram=0i,messages_ack=329i,messages_ready=0i,messages_ack_rate=0.2,consumer_utilisation=1,message_bytes=0i,message_bytes_persist=0i 1493684035000000000

View File

@ -34,25 +34,25 @@ const DefaultClientTimeout = 4
// RabbitMQ defines the configuration necessary for gathering metrics,
// see the sample config for further details
type RabbitMQ struct {
URL string
Name string
Username string
Password string
URL string `toml:"url"`
Name string `toml:"name"`
Username string `toml:"username"`
Password string `toml:"password"`
tls.ClientConfig
ResponseHeaderTimeout internal.Duration `toml:"header_timeout"`
ClientTimeout internal.Duration `toml:"client_timeout"`
Nodes []string
Queues []string
Exchanges []string
Nodes []string `toml:"nodes"`
Queues []string `toml:"queues"`
Exchanges []string `toml:"exchanges"`
QueueInclude []string `toml:"queue_name_include"`
QueueExclude []string `toml:"queue_name_exclude"`
FederationUpstreamInclude []string `toml:"federation_upstream_include"`
FederationUpstreamExclude []string `toml:"federation_upstream_exclude"`
Client *http.Client
Client *http.Client `toml:"-"`
filterCreated bool
excludeEveryQueue bool