diff --git a/attributes/default.rb b/attributes/default.rb index ce9ab040..b30d5d85 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -14,6 +14,7 @@ default['consul']['configure_resolv_conf'] = "true" default['consul']['effective_resolv_conf'] = "" default['consul']['http_api_port'] = "8501" +default['consul']['rpc_port'] = "8300" default['consul']['domain'] = "consul" default['consul']['bind_address'] = "" @@ -29,4 +30,6 @@ default['consul']['health-check']['retryable-check-file'] = "#{node['consul']['bin_dir']}/retryable_health_check.sh" default['consul']['health-check']['max-attempts'] = 7 -default['consul']['health-check']['multiplier'] = 1.2 \ No newline at end of file +default['consul']['health-check']['multiplier'] = 1.2 + +default['consul']['metrics']['prometheus_retention_time'] = "1m" diff --git a/metadata.rb b/metadata.rb index 61ef1efc..ce23ffaa 100644 --- a/metadata.rb +++ b/metadata.rb @@ -51,6 +51,10 @@ attribute "consul/http_api_port", :description => "Port of agent HTTP API", :type => 'string' + +attribute "consul/rpc_port", + :description => "RPC Server port", + :type => 'string' attribute "consul/domain", :description => "Domain to be handled by Consul", @@ -91,3 +95,7 @@ attribute "consul/health-check/multiplier", :description => "If a health check fails it will retry for max-attempts before being declared as dead. This attribute controls the sleep interval between consecutive attempts", :type => 'string' + +attribute "consul/metrics/prometheus_retention_time", + :description => "Retention time for Prometheus metrics", + :type => 'string' diff --git a/templates/default/config/master.hcl.erb b/templates/default/config/master.hcl.erb index 292d923c..3fa9e71b 100644 --- a/templates/default/config/master.hcl.erb +++ b/templates/default/config/master.hcl.erb @@ -23,5 +23,10 @@ cert_file = "<%= @certificate %>" key_file = "<%= @key %>" ports = { http = -1, - https = <%= node['consul']['http_api_port'] %> -} \ No newline at end of file + https = <%= node['consul']['http_api_port'] %>, + server = <%= node['consul']['rpc_port'] %> +} +telemetry = { + prometheus_retention_time = "<%= node['consul']['metrics']['prometheus_retention_time'] %>", + disable_hostname = true +} diff --git a/templates/default/config/slave.hcl.erb b/templates/default/config/slave.hcl.erb index b4a1b6e3..76ac881c 100644 --- a/templates/default/config/slave.hcl.erb +++ b/templates/default/config/slave.hcl.erb @@ -18,5 +18,10 @@ cert_file = "<%= @certificate %>" key_file = "<%= @key %>" ports = { http = -1, - https = <%= node['consul']['http_api_port'] %> -} \ No newline at end of file + https = <%= node['consul']['http_api_port'] %>, + server = <%= node['consul']['rpc_port'] %> +} +telemetry = { + prometheus_retention_time = "<%= node['consul']['metrics']['prometheus_retention_time'] %>", + disable_hostname = true +}