diff --git a/manifests/integrations/cassandra.pp b/manifests/integrations/cassandra.pp index b82c5fd0..6d3af985 100644 --- a/manifests/integrations/cassandra.pp +++ b/manifests/integrations/cassandra.pp @@ -14,6 +14,8 @@ # The password for the datadog user # $tags # Optional array of tags +# $max_returned_metrics +# Optional number of maximum returned metrics, default 350 # # Sample Usage: # @@ -26,11 +28,12 @@ # # class datadog_agent::integrations::cassandra( - String $host = 'localhost', - Integer $port = 7199, - Optional[String] $user = undef, - Optional[String] $password = undef, - Optional[Hash] $tags = {}, + String $host = 'localhost', + Integer $port = 7199, + Optional[String] $user = undef, + Optional[String] $password = undef, + Optional[Hash] $tags = {}, + Optional[Integer] $max_returned_metrics = undef, ) inherits datadog_agent::params { require ::datadog_agent diff --git a/manifests/integrations/mysql.pp b/manifests/integrations/mysql.pp index 0781b121..2973b90e 100644 --- a/manifests/integrations/mysql.pp +++ b/manifests/integrations/mysql.pp @@ -27,6 +27,8 @@ # schema size metrics # $disable_innodb_metrics # disable innodb metrics, used with older versions of MySQL without innodb engine support. +# $dbm +# Database Monitoring for Application Performance Monitoring (APM) # $queries # Custom metrics based on MySQL query # Sample Usage: @@ -51,6 +53,7 @@ # extra_performance_metrics => 'true', # schema_size_metrics => 'true', # disable_innodb_metrics => 'false', +# dbm => 'false', # queries => [ # { # query => 'SELECT TIMESTAMPDIFF(second,MAX(create_time),NOW()) as last_accessed FROM requests', @@ -77,6 +80,7 @@ Boolean $extra_performance_metrics = false, Boolean $schema_size_metrics = false, Boolean $disable_innodb_metrics = false, + Optional[Boolean] $dbm = undef, Optional[Array] $queries = [], Optional[Array] $instances = undef, Optional[Array] $logs = [], @@ -103,6 +107,7 @@ 'extra_performance_metrics' => $extra_performance_metrics, 'schema_size_metrics' => $schema_size_metrics, 'disable_innodb_metrics' => $disable_innodb_metrics, + 'dbm' => $dbm, 'queries' => $queries, }] } elsif !$instances{ diff --git a/spec/classes/datadog_agent_integrations_cassandra_spec.rb b/spec/classes/datadog_agent_integrations_cassandra_spec.rb index ead6d68e..91de455e 100644 --- a/spec/classes/datadog_agent_integrations_cassandra_spec.rb +++ b/spec/classes/datadog_agent_integrations_cassandra_spec.rb @@ -65,7 +65,7 @@ } end - it { is_expected.to contain_file(conf_file).with_content(%r{tags:\s+foo: bar\s+baz: ama\s*?[^-]}m) } + it { is_expected.to contain_file(conf_file).with_content(%r{tags:\s+-\s+foo:bar\s+-\s+baz:ama\s*?[^-]}m) } end context 'tags not hash' do diff --git a/templates/agent-conf.d/cassandra.yaml.erb b/templates/agent-conf.d/cassandra.yaml.erb index 86a5e60d..afc51389 100644 --- a/templates/agent-conf.d/cassandra.yaml.erb +++ b/templates/agent-conf.d/cassandra.yaml.erb @@ -11,9 +11,12 @@ instances: <% if @tags.length > 0 -%> tags: <%- @tags.each do |tag_name, tag_value| -%> - <%= tag_name %>: <%= tag_value %> + - <%= tag_name %>:<%= tag_value %> <% end -%> <% end -%> +<% if @max_returned_metrics -%> + max_returned_metrics: <%= @max_returned_metrics %> +<% end -%> init_config: diff --git a/templates/agent-conf.d/mysql.yaml.erb b/templates/agent-conf.d/mysql.yaml.erb index 44c82873..535bdd5a 100644 --- a/templates/agent-conf.d/mysql.yaml.erb +++ b/templates/agent-conf.d/mysql.yaml.erb @@ -21,6 +21,9 @@ instances: <% if instance['sock'] and instance['sock'] != :undef -%> sock: <%= instance['sock'] %> <% end -%> +<% if instance['dbm'] and instance['dbm'] != :undef -%> + dbm: <%= instance['dbm'] %> +<% end -%> <% if instance['tags'] and ! instance['tags'].empty? -%> tags: