Draft: Adds possibility to call BBS to retrieve stats for application's processes states.
The purpose of this PR is to propose the use of BBS to fetch the RUNNING state of the main application process.
This should help to avoid calls to /v2/space/:space_guid/summary endpoints
bbs internal client is configurable with :
--bbs.api_url=BBS.API_URL BBS API URL ($CF_EXPORTER_BBS_API_URL)
--bbs.ca_file=BBS.CA_FILE BBS CA File ($CF_EXPORTER_BBS_CA_FILE)
--bbs.cert_file=BBS.CERT_FILE
BBS Cert File ($CF_EXPORTER_BBS_CERT_FILE)
--bbs.key_file=BBS.KEY_FILE
BBS Key File ($CF_EXPORTER_BBS_KEY_FILE)
--bbs.skip_ssl_verify Disable SSL Verify for BBS ($CF_EXPORTER_BBS_SKIP_SSL_VERIFY)
--bbs.timeout=5 BBS API Timeout ($CF_EXPORTER_BBS_TIMEOUT)
If bbs is not configured or unreachable, the code switch to the old method using /v2/space/:space_guid/summary to retrieve application running instances number.
Buildpacks information are retrieve with the new relationship introduced since CAPI 1.189.0
Waiting for cloudfoundry/cloud_controller_ng!3863 to be merged and released. This will only work with capi shipping the correct version of cloud_controller_ng
Waiting for cloudfoundry/cli!2933 to be merged.
@gmllt the BBS API URL, what would that be ? => https://github.com/cloudfoundry/cf-deployment/blob/a0f8634a507108481c6b08304719ab7babace102/cf-deployment.yml#L151
I receive always
ERRO[0100] unable to initialize bbs client error="failed to ping BBS"
so would be good if you have an example config, so I can find out what I am doing wrong here
got it to work, setting skip-ssl to true made the trick. Unfortunately the logs do not give you any insights why the connection did not work.
I don't think we do a fallback to the old logic, as it gets removed nevertheless. I would remove the fallback and make the BBS config optional, e.g. if the BBS config is not present do not gather the summary metrics as maybe not everyone wants to make BBS available to their monitoring VMs.
@gmllt could you look into my latest comments and see if you can adjust accordingly?
got it to work, setting skip-ssl to true made the trick. Unfortunately the logs do not give you any insights why the connection did not work.
Unfortunately, I haven't found any methods in the bbs client that allow me to retrieve anything other than a boolean on the connection test. I'll see if it's possible to suggest a modification.
I don't think we do a fallback to the old logic, as it gets removed nevertheless. I would remove the fallback and make the BBS config optional, e.g. if the BBS config is not present do not gather the summary metrics as maybe not everyone wants to make BBS available to their monitoring VMs.
I removed the fallback.
@benjaminguttmann-avtq Currently, it's impossible to go beyond v8.11.0 of the Cloudfoundry CLI; cf_exporter depends on cf-go-client, which no longer works after a breaking change in v8.12.0. I'll look into this.
Currently, it's impossible to go beyond v8.11.0 of the Cloudfoundry CLI; cf_exporter depends on cf-go-client, which no longer works after a breaking change in v8.12.0. I'll look into this.
cf-go-client-helper is now compatible with cloudfoundry/cli 8.13.0
got it to work, setting skip-ssl to true made the trick. Unfortunately the logs do not give you any insights why the connection did not work.
Unfortunately, I haven't found any methods in the bbs client that allow me to retrieve anything other than a boolean on the connection test. I'll see if it's possible to suggest a modification.
Now using ActualLRPs request instead of Ping request. This brings more information is case of error.
@benjaminguttmann-avtq as this is a breaking change, do you think it's interesting to start a github.com/cloudfoundry/cf_exporter/v2 ?
@benjaminguttmann-avtq as this is a breaking change, do you think it's interesting to start a
github.com/cloudfoundry/cf_exporter/v2?
Yes, I think it makes sense if we go with a v2 to mark the start of the only v3-api version
@benjaminguttmann-avtq as this is a breaking change, do you think it's interesting to start a
github.com/cloudfoundry/cf_exporter/v2?Yes, I think it makes sense if we go with a v2 to mark the start of the only v3-api version
Done.
You can consider to merge this PR (or create a new v2 branch) if everything looks good for you :
- Up to date with latest cloudfoundry/cli v8.13.0.
- Using BBS in place of /v2/spaces/:space_guid/summary to retrieve running instances.
- Using ActualLRPs BBS requests to test if BBS configuration works.
- No Fallback to /v2/spaces/:space_guid/summary.
@gmllt you think we should mentioned in the README that configuring the BBS values is optional?
@gmllt is it expected that without configuring BBS I still get cf_application_instances and cf_application_running_instance ?