Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion jobs/rep/spec
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ properties:
description: "Key used to communicate with local metron agent over gRPC"
loggregator.app_metric_exclusion_filter:
description: "Array of application metrics to not emit"
default: []
default:
- cpu_entitlement

diego.rep.listen_addr_admin:
description: "serve (insecure) ping and evacuate requests on this address and port"
Expand Down
4 changes: 4 additions & 0 deletions jobs/rep_windows/spec
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ properties:
description: "Cert used to communicate with local metron agent over gRPC"
loggregator.key:
description: "Key used to communicate with local metron agent over gRPC"
loggregator.app_metric_exclusion_filter:
description: "Array of application metrics to not emit"
default:
- cpu_entitlement

diego.rep.advertise_domain:
description: "base domain at which the rep should advertise its secure API"
Expand Down
3 changes: 2 additions & 1 deletion jobs/rep_windows/templates/rep.json.erb
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@

config[:loggregator]={}
config[:loggregator][:loggregator_use_v2_api] = p("loggregator.use_v2_api")
if p("loggregator.use_v2_api") == true
if p("loggregator.use_v2_api")
config[:loggregator][:loggregator_api_port] = p("loggregator.v2_api_port")
config[:loggregator][:loggregator_ca_path] = "#{conf_dir}/certs/loggregator/ca.crt"
config[:loggregator][:loggregator_cert_path] = "#{conf_dir}/certs/loggregator/client.crt"
Expand All @@ -240,6 +240,7 @@
config[:loggregator][:loggregator_job_origin] = "rep"
config[:loggregator][:loggregator_source_id] = "rep"
config[:loggregator][:loggregator_instance_id] = spec.id
config[:loggregator][:loggregator_app_metric_exclusion_filter] = p("loggregator.app_metric_exclusion_filter")
end

config.to_json
Expand Down
6 changes: 6 additions & 0 deletions spec/rep_template_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@
end.to raise_error(/The locket client keepalive time property should not be larger than the timeout/)
end
end

it 'excludes the newer cpu_entitlement metric by default for backwards compatibility' do
deployment_manifest_fragment['loggregator']['use_v2_api'] = true
expect(JSON.parse(rendered_template)['loggregator']['loggregator_app_metric_exclusion_filter']).to eq(%w[cpu_entitlement])
end

context 'when specific app metrics are configured to be excluded' do
it 'configures the rep to exclude them' do
deployment_manifest_fragment['loggregator']['use_v2_api'] = true
Expand Down