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

If your don't config exchange, this plugin didn't filter all exchanges, even no measurement created. #3882

Closed
crazy-canux opened this issue Mar 13, 2018 · 13 comments
Labels
area/rabbitmq bug unexpected problem or unintended behavior

Comments

@crazy-canux
Copy link
Contributor

func gatherExchanges(r *RabbitMQ, acc telegraf.Accumulator) {

if you didn't specify exchange list, measurements rabbitmq_exchange didn't created.

didn't find out why.

@danielnelson
Copy link
Contributor

What is the response of curl http://localhost:15672/api/exchanges?

@crazy-canux
Copy link
Contributor Author

crazy-canux commented Mar 14, 2018

When I specify nothing for exchange, rabbitmq_exchange not created.
When I specify something, rabbitmq_exchange created.

return all exchanges.:

[{"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":"aws_exchange","vhost":"/","type":"direct","durable":true,"auto_delete":false,"internal":false,"arguments":{}},{"message_stats":{"publish_in":258,"publish_in_details":{"rate":0.0},"publish_out":258,"publish_out_details":{"rate":0.0}},"name":"job_exchange","vhost":"/","type":"direct","durable":true,"auto_delete":false,"internal":false,"arguments":{}},{"name":"report_exchange","vhost":"/","type":"direct","durable":true,"auto_delete":false,"internal":false,"arguments":{}},{"message_stats":{"publish_in":86,"publish_in_details":{"rate":0.0},"publish_out":86,"publish_out_details":{"rate":0.0}},"name":"task_exchange","vhost":"/","type":"direct","durable":true,"auto_delete":false,"internal":false,"arguments":{}}]

@danielnelson
Copy link
Contributor

Can you share your config for the the two cases: with and without exchanges set?

@crazy-canux
Copy link
Contributor Author

crazy-canux commented Mar 14, 2018

Sure, this one.

#   ## A list of exchanges to gather as the rabbitmq_exchange measurement. If not
#   ## specified, metrics for all exchanges are gathered.
    exchanges = ["job_exchange", "task_exchange", "report_exchange"]

@danielnelson danielnelson added bug unexpected problem or unintended behavior area/rabbitmq and removed need more info labels Mar 14, 2018
@crazy-canux
Copy link
Contributor Author

But, when I create another influxdb and telegraf, it's works.
No idea what's happend on another stack.

@danielnelson
Copy link
Contributor

Maybe it is a permissions issue?

@crazy-canux
Copy link
Contributor Author

impossible, I got other measurements with the same url.

@Art1k
Copy link

Art1k commented Apr 1, 2018

Hey, i've got the same issue, no exchange metrics for blank.
If i try to put regex or something i get parsing error

Conf:

[[inputs.rabbitmq]]
  ## Management Plugin url. (default: http://localhost:15672)
  # url = "http://localhost:15672"
  ## Tag added to rabbitmq_overview series; deprecated: use tags
  # name = "rmq-server-1"
  ## Credentials
  username = ""
  password = ""
  
  ## Optional SSL Config
  # ssl_ca = "/etc/telegraf/ca.pem"
  # ssl_cert = "/etc/telegraf/cert.pem"
  # ssl_key = "/etc/telegraf/key.pem"
  ## Use SSL but skip chain & host verification
  # insecure_skip_verify = false

  ## Optional request timeouts
  ##
  ## ResponseHeaderTimeout, if non-zero, specifies the amount of time to wait
  ## for a server's response headers after fully writing the request.
  # header_timeout = "3s"
  ##
  ## client_timeout specifies a time limit for requests made by this client.
  ## Includes connection time, any redirects, and reading the response body.
  # client_timeout = "4s"

  ## A list of nodes to gather as the rabbitmq_node measurement. If not
  ## specified, metrics for all nodes are gathered.
  # nodes = ["rabbit@node1", "rabbit@node2"]

  ## A list of queues to gather as the rabbitmq_queue measurement. If not
  ## specified, metrics for all queues are gathered.
  # queues = ["telegraf"]

  ## A list of exchanges to gather as the rabbitmq_exchange measurement. If not
  ## specified, metrics for all exchanges are gathered.
  # exchanges = ["telegraf"] - No metric rabbitmq_exchange
  exchanges = ["*"] - Results in parsing error
  exchanges = [".*"] - Results in parsing error

  ## Queues to include and exclude. Globs accepted.
  ## Note that an empty array for both will include all queues
  # queue_name_include = []
  # queue_name_exclude = []

parsing error

/usr/bin/telegraf -config /etc/telegraf/telegraf.conf -config-directory /etc/telegraf/telegraf.d
2018/04/01 08:15:26 E! Error parsing /etc/telegraf/telegraf.d/input_rabbitmq.conf, line 37: field corresponding to exchanges' is not defined in *rabbitmq.RabbitMQ'

P.S: Reinstalling telegraf didn't help: yum erase -y telegraf && yum install -y telegraf

@danielnelson
Copy link
Contributor

@Art1k This option is only in the next release (1.6)

@Art1k
Copy link

Art1k commented Apr 3, 2018

@danielnelson
Thank you, got ya
Is there an ETA for 1.6?

@danielnelson
Copy link
Contributor

Depends on what is found in testing but I expect it in about 2 weeks. There is an release candidate available, it would be great if you could verify everything is working as expected:

https://community.influxdata.com/t/telegraf-v1-6-0-rc2/4601

@Art1k
Copy link

Art1k commented Apr 3, 2018

@danielnelson Cool thanks, i'll verify it and update

@sspaink
Copy link
Contributor

sspaink commented Mar 11, 2022

Closing because from the comments it seems this was resolved in v1.6

@sspaink sspaink closed this as completed Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/rabbitmq bug unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

4 participants