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
21 changes: 21 additions & 0 deletions jobs/cf_exporter/spec
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions jobs/cf_exporter/templates/bbs_ca.pem.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<%= p('cf_exporter.bbs.ca', '') %>
1 change: 1 addition & 0 deletions jobs/cf_exporter/templates/bbs_cert.pem.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<%= p('cf_exporter.bbs.cert', '') %>
1 change: 1 addition & 0 deletions jobs/cf_exporter/templates/bbs_key.pem.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<%= p('cf_exporter.bbs.key', '') %>
13 changes: 13 additions & 0 deletions jobs/cf_exporter/templates/bpm.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,26 @@ 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|
env[envKey] = specValue
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
Expand Down
2 changes: 1 addition & 1 deletion jobs/prometheus/templates/config/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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|
Expand Down