Categorygithub.com/orange-cloudfoundry/bosh_exporter
repositorypackage
2.4.0+incompatible
Repository: https://github.com/orange-cloudfoundry/bosh_exporter.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author

# README

BOSH Prometheus Exporter Build Status

A Prometheus exporter for BOSH metrics. Please refer to the FAQ for general questions about this exporter.

Architecture overview

Installation

Binaries

Download the already existing binaries for your platform:

$ ./bosh_exporter <flags>

From source

Using the standard go install (you must have Go already installed in your local machine):

$ go install github.com/cloudfoundry-community/bosh_exporter
$ bosh_exporter <flags>

Cloud Foundry

The exporter can be deployed to an already existing Cloud Foundry environment:

$ git clone https://github.com/cloudfoundry-community/bosh_exporter.git
$ cd bosh_exporter

Modify the included application manifest file to include your BOSH properties. Then you can push the exporter to your Cloud Foundry environment:

$ cf push

BOSH

This exporter can be deployed using the Prometheus BOSH Release.

Usage

Flags

Flag / Environment VariableRequiredDefaultDescription
bosh.url
BOSH_EXPORTER_BOSH_URL
YesBOSH URL
bosh.username
BOSH_EXPORTER_BOSH_USERNAME
[1]BOSH Username
bosh.password
BOSH_EXPORTER_BOSH_PASSWORD
[1]BOSH Password
bosh.uaa.client-id
BOSH_EXPORTER_BOSH_UAA_CLIENT_ID
[1]BOSH UAA Client ID
bosh.uaa.client-secret
BOSH_EXPORTER_BOSH_UAA_CLIENT_SECRET
[1]BOSH UAA Client Secret
bosh.log-level
BOSH_EXPORTER_BOSH_LOG_LEVEL
NoERRORBOSH Log Level (DEBUG, INFO, WARN, ERROR, NONE)
bosh.ca-cert-file
BOSH_EXPORTER_BOSH_CA_CERT_FILE
NoBOSH CA Certificate file
filter.deployments
BOSH_EXPORTER_FILTER_DEPLOYMENTS
NoComma separated deployments to filter
filter.azs
BOSH_EXPORTER_FILTER_AZS
NoComma separated AZs to filter
filter.collectors
BOSH_EXPORTER_FILTER_COLLECTORS
NoComma separated collectors to filter. If not set, all collectors will be enabled (Deployments, Jobs, ServiceDiscovery)
metrics.namespace
BOSH_EXPORTER_METRICS_NAMESPACE
NoboshMetrics Namespace
metrics.environment
BOSH_EXPORTER_METRICS_ENVIRONMENT
NoEnvironment label to be attached to metrics
sd.filename
BOSH_EXPORTER_SD_FILENAME
Nobosh_target_groups.jsonFull path to the Service Discovery output file
sd.processes_regexp
BOSH_EXPORTER_SD_PROCESSES_REGEXP
NoRegexp to filter Service Discovery processes names
web.listen-address
BOSH_EXPORTER_WEB_LISTEN_ADDRESS
No:9190Address to listen on for web interface and telemetry
web.telemetry-path
BOSH_EXPORTER_WEB_TELEMETRY_PATH
No/metricsPath under which to expose Prometheus metrics
web.auth.username
BOSH_EXPORTER_WEB_AUTH_USERNAME
NoUsername for web interface basic auth
web.auth.pasword
BOSH_EXPORTER_WEB_AUTH_PASSWORD
NoPassword for web interface basic auth
web.tls.cert_file
BOSH_EXPORTER_WEB_TLS_CERTFILE
NoPath to a file that contains the TLS certificate (PEM format). If the certificate is signed by a certificate authority, the file should be the concatenation of the server's certificate, any intermediates, and the CA's certificate
web.tls.key_file
BOSH_EXPORTER_WEB_TLS_KEYFILE
NoPath to a file that contains the TLS private key (PEM format)

[1] When BOSH delegates user managament to UAA, either bosh.username and bosh.password or bosh.uaa.client-id and bosh.uaa.client-secret flags may be used; otherwise bosh.username and bosh.password will be required.

Metrics

The exporter returns the following metrics:

MetricDescriptionLabels
metrics.namespace_scrapes_totalTotal number of times BOSH was scraped for metricsenvironment, bosh_name, bosh_uuid
metrics.namespace_scrape_errors_totalTotal number of times an error occured scraping BOSHenvironment, bosh_name, bosh_uuid
metrics.namespace_last_scrape_errorWhether the last scrape of metrics from BOSH resulted in an error (1 for error, 0 for success)environment, bosh_name, bosh_uuid
metrics.namespace_last_scrape_timestampNumber of seconds since 1970 since last scrape from BOSHenvironment, bosh_name, bosh_uuid
metrics.namespace_last_scrape_duration_secondsDuration of the last scrape from BOSHenvironment, bosh_name, bosh_uuid

The exporter returns the following Deployments metrics:

MetricDescriptionLabels
metrics.namespace_deployment_release_infoLabeled BOSH Deployment Release Info with a constant 1 valueenvironment, bosh_name, bosh_uuid, bosh_deployment, bosh_release_name, bosh_release_version
metrics.namespace_deployment_stemcell_infoLabeled BOSH Deployment Stemcell Info with a constant 1 valueenvironment, bosh_name, bosh_uuid, bosh_deployment, bosh_stemcell_name, bosh_stemcell_version, bosh_stemcell_os_name
metrics.namespace_last_deployments_scrape_timestampNumber of seconds since 1970 since last scrape of Deployments metrics from BOSHenvironment, bosh_name, bosh_uuid
metrics.namespace_last_deployments_scrape_duration_secondsDuration of the last scrape of Deployments metrics from BOSHenvironment, bosh_name, bosh_uuid

The exporter returns the following Jobs metrics:

MetricDescriptionLabels
metrics.namespace_job_healthyBOSH Job Healthy (1 for healthy, 0 for unhealthy)environment, bosh_name, bosh_uuid, bosh_deployment, bosh_job_name, bosh_job_id, bosh_job_index, bosh_job_az, bosh_job_ip
metrics.namespace_job_load_avg01BOSH Job Load avg01environment, bosh_name, bosh_uuid, bosh_deployment, bosh_job_name, bosh_job_id, bosh_job_index, bosh_job_az, bosh_job_ip
metrics.namespace_job_load_avg05BOSH Job Load avg05environment, bosh_name, bosh_uuid, bosh_deployment, bosh_job_name, bosh_job_id, bosh_job_index, bosh_job_az, bosh_job_ip
metrics.namespace_job_load_avg15BOSH Job Load avg15environment, bosh_name, bosh_uuid, bosh_deployment, bosh_job_name, bosh_job_id, bosh_job_index, bosh_job_az, bosh_job_ip
metrics.namespace_job_cpu_sysBOSH Job CPU Systemenvironment, bosh_name, bosh_uuid, bosh_deployment, bosh_job_name, bosh_job_id, bosh_job_index, bosh_job_az, bosh_job_ip
metrics.namespace_job_cpu_userBOSH Job CPU Userenvironment, bosh_name, bosh_uuid, bosh_deployment, bosh_job_name, bosh_job_id, bosh_job_index, bosh_job_az, bosh_job_ip
metrics.namespace_job_cpu_waitBOSH Job CPU Waitenvironment, bosh_name, bosh_uuid, bosh_deployment, bosh_job_name, bosh_job_id, bosh_job_index, bosh_job_az, bosh_job_ip
metrics.namespace_job_mem_kbBOSH Job Memory KBenvironment, bosh_name, bosh_uuid, bosh_deployment, bosh_job_name, bosh_job_id, bosh_job_index, bosh_job_az, bosh_job_ip
metrics.namespace_job_mem_percentBOSH Job Memory Percentenvironment, bosh_name, bosh_uuid, bosh_deployment, bosh_job_name, bosh_job_id, bosh_job_index, bosh_job_az, bosh_job_ip
metrics.namespace_job_swap_kbBOSH Job Swap KBenvironment, bosh_name, bosh_uuid, bosh_deployment, bosh_job_name, bosh_job_id, bosh_job_index, bosh_job_az, bosh_job_ip
metrics.namespace_job_swap_percentBOSH Job Swap Percentenvironment, bosh_name, bosh_uuid, bosh_deployment, bosh_job_name, bosh_job_id, bosh_job_index, bosh_job_az, bosh_job_ip
metrics.namespace_job_system_disk_inode_percentBOSH Job System Disk Inode Percentenvironment, bosh_name, bosh_uuid, bosh_deployment, bosh_job_name, bosh_job_id, bosh_job_index, bosh_job_az, bosh_job_ip
metrics.namespace_job_system_disk_percentBOSH Job System Disk Percentenvironment, bosh_name, bosh_uuid, bosh_deployment, bosh_job_name, bosh_job_id, bosh_job_index, bosh_job_az, bosh_job_ip
metrics.namespace_job_ephemeral_disk_inode_percentBOSH Job Ephemeral Disk Inode Percentenvironment, bosh_name, bosh_uuid, bosh_deployment, bosh_job_name, bosh_job_id, bosh_job_index, bosh_job_az, bosh_job_ip
metrics.namespace_job_ephemeral_disk_percentBOSH Job Ephemeral Disk Percentenvironment, bosh_name, bosh_uuid, bosh_deployment, bosh_job_name, bosh_job_id, bosh_job_index, bosh_job_az, bosh_job_ip
metrics.namespace_job_persistent_disk_inode_percentBOSH Job Persistent Disk Inode Percentenvironment, bosh_name, bosh_uuid, bosh_deployment, bosh_job_name, bosh_job_id, bosh_job_index, bosh_job_az, bosh_job_ip
metrics.namespace_job_persistent_disk_percentBOSH Job Persistent Disk Percentenvironment, bosh_name, bosh_uuid, bosh_deployment, bosh_job_name, bosh_job_id, bosh_job_index, bosh_job_az, bosh_job_ip
metrics.namespace_job_process_healthyBOSH Job Process Healthy (1 for healthy, 0 for unhealthy)environment, bosh_name, bosh_uuid, bosh_deployment, bosh_job_name, bosh_job_id, bosh_job_index, bosh_job_az, bosh_job_ip, bosh_job_process_name
metrics.namespace_job_process_uptime_secondsBOSH Job Process Uptime in secondsenvironment, bosh_name, bosh_uuid, bosh_deployment, bosh_job_name, bosh_job_id, bosh_job_index, bosh_job_az, bosh_job_ip, bosh_job_process_name
metrics.namespace_job_process_cpu_totalBOSH Job Process CPU Totalenvironment, bosh_name, bosh_uuid, bosh_deployment, bosh_job_name, bosh_job_id, bosh_job_index, bosh_job_az, bosh_job_ip, bosh_job_process_name
metrics.namespace_job_process_mem_kbBOSH Job Process Memory KBenvironment, bosh_name, bosh_uuid, bosh_deployment, bosh_job_name, bosh_job_id, bosh_job_index, bosh_job_az, bosh_job_ip, bosh_job_process_name
metrics.namespace_job_process_mem_percentBOSH Job Process Memory Percentenvironment, bosh_name, bosh_uuid, bosh_deployment, bosh_job_name, bosh_job_id, bosh_job_index, bosh_job_az, bosh_job_ip, bosh_job_process_name
metrics.namespace_last_jobs_scrape_timestampNumber of seconds since 1970 since last scrape of Job metrics from BOSHenvironment, bosh_name, bosh_uuid
metrics.namespace_last_jobs_scrape_duration_secondsDuration of the last scrape of Job metrics from BOSHenvironment, bosh_name, bosh_uuid

The exporter returns the following ServiceDiscovery metrics:

MetricDescriptionLabels
metrics.namespace_last_service_discovery_scrape_timestampNumber of seconds since 1970 since last scrape of Service Discovery from BOSHenvironment, bosh_name, bosh_uuid
metrics.namespace_last_service_discovery_scrape_duration_secondsDuration of the last scrape of Service Discovery from BOSHenvironment, bosh_name, bosh_uuid

Service Discovery

If the ServiceDiscovery collector is enabled, the exporter will write a json file at the sd.filename location containing a list of static configs that can be used with the Prometheus file-based service discovery mechanism:

[
  {
    "targets": ["10.244.0.12"],
    "labels":
      {
        "__meta_bosh_job_process_name": "bosh_exporter"
      }
  },
  {
    "targets": ["10.244.0.11", "10.244.0.12", "10.244.0.13", "10.244.0.14"],
    "labels":
      {
        "__meta_bosh_job_process_name": "node_exporter"
      }
  }
]

The list of targets can be filtered using the sd.processes_regexp flag.

Contributing

Refer to the contributing guidelines.

License

Apache License 2.0, see LICENSE.