Prometheus BOSH Release
This is a BOSH release for Prometheus, Alertmanager, and Grafana. It also includes various
Prometheus exporters and Grafana plugins.
The detailed list of included components and their maintenance status is available on VERSIONS.md
Questions? Pop in our Slack channel!
Table of Contents
Usage
Requirements
In order to use this BOSH release you will need:
Although not mandatory, it is recommended to deploy the node exporter addon in order to get system metrics.
Clone the repository
First, clone this repository into your workspace:
git clone https://github.com/bosh-prometheus/prometheus-boshrelease
cd prometheus-boshrelease
export BOSH_ENVIRONMENT=<name>
Then checkout to the release branch you want to use, so manifest files will be in synch with the release version:
Basic deployment
To deploy a basic prometheus server with alertmanager and grafana (but no exporters) use the following command:
bosh -d prometheus deploy manifests/prometheus.yml \
--vars-store tmp/deployment-vars.yml
Once deployed, look for the nginx instance IP address:
bosh -d prometheus instances
You can reach each component's web ui at:
alertmanager: http://<nginx-ip-address>:9093
grafana: http://<nginx-ip-address>:3000
prometheus: http://<nginx-ip-address>:9090
Credentials for each components can be located at the tmp/deployment-vars.yml file.
Using BOSH Service Discovery
If you want to use the BOSH Service Discovery in order to dynamically discover your exporters then add the monitor-bosh.yml op file by running the following command (filling the required variables with your own values):
bosh -d prometheus deploy manifests/prometheus.yml \
--vars-store tmp/deployment-vars.yml \
-o manifests/operators/monitor-bosh.yml \
-v bosh_url= \
-v bosh_username= \
-v bosh_password= \
--var-file bosh_ca_cert= \
-v metrics_environment=
NOTE: metrics_environment is an arbitrary name to identify your environment (test, nyc-prod, ...)
If you have configured your bosh-deployment to use UAA user management (via the uaa.yml ops file) we recommend adding the add-bosh-exporter-uaa-clients.yml op file to your bosh-deployment and then adding the enable-bosh-uaa.yml ops file to the prometheus deployment by running the following command (filling the required variables with your own values):
bosh -d prometheus deploy manifests/prometheus.yml \
--vars-store tmp/deployment-vars.yml \
-o manifests/operators/monitor-bosh.yml \
-o manifests/operators/enable-bosh-uaa.yml \
-v bosh_url= \
--var-file bosh_ca_cert= \
-v metrics_environment=
In case you have configured manually an UAA client_id for the bosh_exporter (different from bosh_exporter), then run the following command instead:
bosh -d prometheus deploy manifests/prometheus.yml \
--vars-store tmp/deployment-vars.yml \
-o manifests/operators/monitor-bosh.yml \
-o manifests/operators/enable-bosh-uaa.yml \
-o manifests/operators/configure-bosh-exporter-uaa-client-id.yml \
-v bosh_url= \
-v uaa_bosh_exporter_client_id= \
-v uaa_bosh_exporter_client_secret= \
--var-file bosh_ca_cert= \
-v metrics_environment=
Monitoring Cloud Foundry
If you want to monitor your Cloud Foundry platform, first update your
cf-deployment adding the add-prometheus-uaa-clients.yml
op file.
This will add the UAA clients required to gather information from the Cloud Foundry API
and Firehose. Then add the monitor-cf.yml ops file by running the following
command (filling the required variables with your own values):
bosh -d prometheus deploy manifests/prometheus.yml \
--vars-store tmp/deployment-vars.yml \
-o manifests/operators/monitor-bosh.yml \
-v bosh_url= \
-v bosh_username= \
-v bosh_password= \
--var-file bosh_ca_cert= \
-v metrics_environment= \
-o manifests/operators/monitor-cf.yml \
-v metron_deployment_name= \
-v system_domain= \
-v uaa_clients_cf_exporter_secret= \
-v loggregator_ca_name= \
-v skip_ssl_verify=
NOTE: metron_deployment_name property should match the deployment property of your metron_agent or loggregator_agent jobs.
Use:
NOTE: loggregator_ca_name property should match the full credhub path of loggregator_ca certificate variable, ex: /bosh-mydirector/cf/loggregator_ca.
NOTE: You can switch to legacy implementation of firehose_exporter and legacy
cloud foundry dashboards by adding the following ops-files:
- on prometheus deployment, adapt:
...
-o manifests/operators/monitor-cf.yml \
-o manifests/operators/deprecated/monitor-cf-attic.yml \
-v uaa_clients_firehose_exporter_secret= \
-v traffic_controller_external_port= \
...
- When using
add-prometheus-uaa-clients.yml on cloud foundry deployment, adapt:
...
-o manifests/operators/cf/add-prometheus-uaa-clients.yml
-o manifests/operators/deprecated/cf/add-prometheus-uaa-clients-attic.yml
...
This will switch deployment to firehose_exporter-attic, cloudfoundry_dashboards-attic and cloudfoundry_alerts-attic
Register Cloud Foundry routes
If you want to access alertmanager, grafana, and prometheus web ui's using your Cloud Foundry system domain instead of IP addresses, then you can register those routes inside your Cloud Foundry environment using the enable-cf-route-registrar.yml op file by running the following command (filling the required variables with your own values):
bosh -d prometheus deploy manifests/prometheus.yml \
--vars-store tmp/deployment-vars.yml \
...
-o manifests/operators/enable-cf-route-registrar.yml \
-v system_domain= \
-v cf_deployment_name=
The op file will register the following routes:
https://alertmanager.<cf system domain>
https://grafana.<cf system domain>
https://prometheus.<cf system domain>
Use UAA for Grafana authentication
If you want to allow users registered at your Cloud Foundry environment to access the Grafana dashboards (Viewer mode only), first update your cf-deployment adding the add-grafana-uaa-clients.yml op file. This will add the UAA client required by the Grafana-UAA integration.
Then add the enable-grafana-uaa.yml op file by running the following command (filling the required variables with your own values):
bosh -d prometheus deploy manifests/prometheus.yml \
--vars-store tmp/deployment-vars.yml \
...
-o manifests/operators/enable-grafana-uaa.yml \
-v system_domain= \
-v uaa_clients_grafana_secret= \
--var-file uaa_ssl.ca= \
--var-file uaa_ssl.certificate= \
--var-file uaa_ssl.private_key=
Operations files
Additional operations files are located at the manifests/operators directory. Those files includes a basic configuration, so extra ops files might be needed for additional configuration.
Please review the op files before deploying them to check the requirements, dependencies and necessary variables.
| File |
Description |
exporter |
dashboards |
alerts |