From 26fd0ce2bd498bf3f635046da4216ea41be2b556 Mon Sep 17 00:00:00 2001 From: Ian Crouch Date: Thu, 11 May 2017 14:27:20 -0400 Subject: [PATCH 1/3] Updating redis.pp to include new command_stats --- manifests/integrations/redis.pp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/manifests/integrations/redis.pp b/manifests/integrations/redis.pp index 109788ff..a537b277 100644 --- a/manifests/integrations/redis.pp +++ b/manifests/integrations/redis.pp @@ -17,6 +17,8 @@ # Optional array of tags # $keys # Optional array of keys to check length +# $command_stats +# Collect INFO COMMANDSTATS output as metrics # # Sample Usage: # @@ -34,12 +36,15 @@ $tags = [], $keys = [], $warn_on_missing_keys = true, + $command_stats = false, + ) inherits datadog_agent::params { include datadog_agent validate_array($tags) validate_array($keys) validate_bool($warn_on_missing_keys) + validate_bool($command_stats) if $ports == undef { $_ports = [ $port ] From adbc0aa42d2780f252bb9a7e1cfc103cef95af8f Mon Sep 17 00:00:00 2001 From: Ian Crouch Date: Thu, 11 May 2017 14:29:21 -0400 Subject: [PATCH 2/3] Add command_stats to template --- templates/agent-conf.d/redisdb.yaml.erb | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/agent-conf.d/redisdb.yaml.erb b/templates/agent-conf.d/redisdb.yaml.erb index 99c61e61..c522c45e 100644 --- a/templates/agent-conf.d/redisdb.yaml.erb +++ b/templates/agent-conf.d/redisdb.yaml.erb @@ -9,6 +9,7 @@ instances: - host: <%= @host %> port: <%= port %> warn_on_missing_keys: <%= @warn_on_missing_keys %> + command_stats: <%= @command_stats %> <% if @password.empty? %># <%end %>password: <%= @password %> # unix_socket_path: /var/run/redis/redis.sock # optional, can be used in lieu of host/port <% if @slowlog_max_len.empty? %># <%end %>slowlog-max-len: <%= @slowlog_max_len %> From 054b494f72a9c9e1931a92467c6555b99405620b Mon Sep 17 00:00:00 2001 From: Ian Crouch Date: Wed, 17 May 2017 17:34:46 -0400 Subject: [PATCH 3/3] Updating redis spec --- spec/classes/datadog_agent_integrations_redis_spec.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spec/classes/datadog_agent_integrations_redis_spec.rb b/spec/classes/datadog_agent_integrations_redis_spec.rb index cc10fbe8..e15d9017 100644 --- a/spec/classes/datadog_agent_integrations_redis_spec.rb +++ b/spec/classes/datadog_agent_integrations_redis_spec.rb @@ -28,6 +28,7 @@ it { should contain_file(conf_file).without_content(%r{tags:}) } it { should contain_file(conf_file).without_content(%r{\bkeys:}) } it { should contain_file(conf_file).with_content(%r{warn_on_missing_keys: true}) } + it { should contain_file(conf_file).with_content(%r{command_stats: false}) } end context 'with parameters set' do @@ -39,6 +40,7 @@ tags: %w{foo bar}, keys: %w{baz bat}, warn_on_missing_keys: false, + command_stats: true, }} it { should contain_file(conf_file).with_content(%r{host: redis1}) } it { should contain_file(conf_file).with_content(%r{^[^#]*password: hunter2}) } @@ -47,6 +49,7 @@ it { should contain_file(conf_file).with_content(%r{tags:.*\s+- foo\s+- bar}) } it { should contain_file(conf_file).with_content(%r{keys:.*\s+- baz\s+- bat}) } it { should contain_file(conf_file).with_content(%r{warn_on_missing_keys: false}) } + it { should contain_file(conf_file).with_content(%r{command_stats: true}) } end end