In the rabbitmq integration, adding max_detailed_queues, fixing tabs on max_detailed_exchanges and timeout, and adding tests.
MODIFY
kitchen.yml
kitchen.yml
@@ -460,6 +460,39 @@ suites:
- "somepid"
- "pidname"
+- name: datadog_rabbitmq
+ run_list:
+ - recipe[datadog::rabbitmq]
+ attributes:
+ datadog:
+ <<: *DATADOG
+ rabbitmq:
+ instances:
+ - api_url: 'http://localhost:15672/api/'
+ user: someuser
+ pass: somepassword
+ max_detailed_exchanges: 300
+ max_detailed_queues: 300
+ tags:
+ - tag1
+ - tag2
+ nodes:
+ - node1
+ - node2
+ nodes_regexes:
+ - node3.*
+ - node4.*
+ queues:
+ - queue1
+ - queue2
+ queues_regexes:
+ - queue3.*
+ - queue4.*
+ vhosts:
+ - vhost1
+ - vhost2
+ timeout: 30
+
- name: datadog_ssh_check
run_list:
- recipe[datadog::ssh_check]

MODIFY
templates/default/rabbitmq.yaml.erb
templates/default/rabbitmq.yaml.erb
@@ -15,6 +15,9 @@ instances:
<% if i.key?('max_detailed_exchanges') -%>
max_detailed_exchanges: <%= i['max_detailed_exchanges'] %>
<% end -%>
+ <% if i.key?('max_detailed_queues') -%>
+ max_detailed_queues: <%= i['max_detailed_queues'] %>
+ <% end -%>
<% if i.key?('tags') -%>
tags:
<% i['tags'].each do |x| -%>

ADD
test/integration/datadog_rabbitmq/serverspec/rabbitmq_spec.rb
+# Encoding: utf-8
+
+require 'spec_helper'
+
+AGENT_CONFIG = File.join(@agent_config_dir, 'conf.d/rabbitmq.d/conf.yaml')
+
+describe service(@agent_service_name) do
+ it { should be_running }
+end
+
+describe file(AGENT_CONFIG) do
+ it { should be_a_file }
+
+ it 'is valid yaml matching input values' do
+ generated = YAML.load_file(AGENT_CONFIG)
+
+ expected = {
+ 'instances' => [
+ {
+ 'rabbitmq_api_url' => 'http://localhost:15672/api/',
+ 'rabbitmq_user' => 'someuser',
+ 'rabbitmq_pass' => 'somepassword',
+ 'ssl_verify' => true,
+ 'tag_families' => false,
+ 'max_detailed_exchanges' => 300,
+ 'max_detailed_queues' => 300,
+ 'tags' => ['tag1', 'tag2'],
+ 'nodes' => ['node1', 'node2'],
+ 'nodes_regexes' => ['node3.*', 'node4.*'],
+ 'vhosts' => ['vhost1', 'vhost2'],
+ 'queues' => ['queue1', 'queue2'],
+ 'queues_regexes' => ['queue3.*', 'queue4.*'],
+ 'timeout' => 30
+ }
+ ],
+ 'logs' => nil,
+ 'init_config' => nil
+ }
+
+ expect(generated.to_json).to be_json_eql expected.to_json
+ end
+end

In the rabbitmq integration, adding max_detailed_queues, fixing tabs on max_detailed_exchanges and timeout, and adding tests. (#785)

Co-authored-by: Alex Brehm <alexander.brehm@e-hps.com>