diff --git a/jobs/cf_exporter/spec b/jobs/cf_exporter/spec index 67a3a89d..2cf90288 100644 --- a/jobs/cf_exporter/spec +++ b/jobs/cf_exporter/spec @@ -8,6 +8,9 @@ templates: bpm.yml.erb: config/bpm.yml web_tls_cert.pem.erb: config/web_tls_cert.pem web_tls_key.pem.erb: config/web_tls_key.pem + bbs_ca.pem.erb: config/bbs_ca.pem + bbs_cert.pem.erb: config/bbs_cert.pem + bbs_key.pem.erb: config/bbs_key.pem properties: cf_exporter.cf.api_url: @@ -54,6 +57,24 @@ properties: cf_exporter.web.tls_key: description: "TLS private key (PEM format)" + + cf_exporter.bbs.api_url: + description: "BBS API URL" + cf_exporter.bbs.ca: + description: "CA certificate for BBS API" + cf_exporter.bbs.cert: + description: "Certificate for BBS API" + cf_exporter.bbs.key: + description: "Private key for BBS API" + cf_exporter.bbs.skip_ssl_verify: + description: "Disable SSL Verify for BBS" + default: false + cf_exporter.bbs.timeout: + description: "BBS API Timeout" + default: 30 + + + env.http_proxy: description: "HTTP proxy to use" env.https_proxy: diff --git a/jobs/cf_exporter/templates/bbs_ca.pem.erb b/jobs/cf_exporter/templates/bbs_ca.pem.erb new file mode 100644 index 00000000..d9a600f6 --- /dev/null +++ b/jobs/cf_exporter/templates/bbs_ca.pem.erb @@ -0,0 +1 @@ +<%= p('cf_exporter.bbs.ca', '') %> \ No newline at end of file diff --git a/jobs/cf_exporter/templates/bbs_cert.pem.erb b/jobs/cf_exporter/templates/bbs_cert.pem.erb new file mode 100644 index 00000000..6771fef1 --- /dev/null +++ b/jobs/cf_exporter/templates/bbs_cert.pem.erb @@ -0,0 +1 @@ +<%= p('cf_exporter.bbs.cert', '') %> \ No newline at end of file diff --git a/jobs/cf_exporter/templates/bbs_key.pem.erb b/jobs/cf_exporter/templates/bbs_key.pem.erb new file mode 100644 index 00000000..97e60334 --- /dev/null +++ b/jobs/cf_exporter/templates/bbs_key.pem.erb @@ -0,0 +1 @@ +<%= p('cf_exporter.bbs.key', '') %> \ No newline at end of file diff --git a/jobs/cf_exporter/templates/bpm.yml.erb b/jobs/cf_exporter/templates/bpm.yml.erb index a940a3b3..79ab9c25 100644 --- a/jobs/cf_exporter/templates/bpm.yml.erb +++ b/jobs/cf_exporter/templates/bpm.yml.erb @@ -25,6 +25,9 @@ specMap = { "cf_exporter.metrics.namespace" => "CF_EXPORTER_METRICS_NAMESPACE", "cf_exporter.metrics.environment" => "CF_EXPORTER_METRICS_ENVIRONMENT", "cf_exporter.web.telemetry_path" => "CF_EXPORTER_WEB_TELEMETRY_PATH", + "cf_exporter.bbs.api_url" => "CF_EXPORTER_BBS_API_URL", + "cf_exporter.bbs.skip_ssl_verify" => "CF_EXPORTER_BBS_SKIP_SSL_VERIFY", + "cf_exporter.bbs.timeout" => "CF_EXPORTER_BBS_TIMEOUT" } specMap.each { |specKey, envKey| if_p(specKey) do |specValue| @@ -32,6 +35,16 @@ specMap.each { |specKey, envKey| end } + +# Configure BBS settings if api_url is provided +if_p("cf_exporter.bbs.ca", "cf_exporter.bbs.cert", "cf_exporter.bbs.key") do + env["CF_EXPORTER_BBS_CA_FILE"] = "/var/vcap/jobs/cf_exporter/config/bbs_ca.pem" + env["CF_EXPORTER_BBS_CERT_FILE"] = "/var/vcap/jobs/cf_exporter/config/bbs_cert.pem" + env["CF_EXPORTER_BBS_KEY_FILE"] = "/var/vcap/jobs/cf_exporter/config/bbs_key.pem" +end + + + # when property value is true # -> not "if property exists" # -> always defined since it has a default value in spec diff --git a/jobs/prometheus/templates/config/prometheus.yml b/jobs/prometheus/templates/config/prometheus.yml index bbdfbd88..2bc5238c 100644 --- a/jobs/prometheus/templates/config/prometheus.yml +++ b/jobs/prometheus/templates/config/prometheus.yml @@ -24,7 +24,7 @@ global: <% end %> # Rule files specifies a list of files from which rules are read. -rule_files: <%= p('prometheus.rule_files', []).push('/var/vcap/jobs/prometheus2/config/custom.rules.yml').to_json %> +rule_files: <%= p('prometheus.rule_files', []).push('/var/vcap/jobs/prometheus/config/custom.rules.yml').to_json %> # A list of scrape configurations. <% scrape_configs = p('prometheus.scrape_configs', []).map do |scrape_config|