A Prometheus exporter for Shield. Please refer to the FAQ for general questions about this exporter.
Download the already existing binaries for your platform:
$ ./shield_exporter <flags>Using the standard go install (you must have Go already installed in your local machine):
$ go install github.com/bosh-prometheus/shield_exporter
$ shield_exporter <flags>To run the shield exporter as a Docker container, run:
docker run -p 9179:9179 boshprometheus/shield-exporter <flags>The exporter can be deployed to an already existing Cloud Foundry environment:
$ git clone https://github.com/bosh-prometheus/shield_exporter.git
$ cd shield_exporterModify the included application manifest file to include your Shield properties. Then you can push the exporter to your Cloud Foundry environment:
$ cf pushThis exporter can be deployed using the Prometheus BOSH Release.
| Flag / Environment Variable | Required | Default | Description |
|---|---|---|---|
shield.backend_urlSHIELD_EXPORTER_SHIELD_BACKEND_URL |
Yes | Shield Backend URL [1] | |
shield.usernameSHIELD_EXPORTER_SHIELD_USERNAME |
Yes | Shield Username | |
shield.passwordSHIELD_EXPORTER_SHIELD_PASSWORD |
Yes | Shield Password | |
filter.collectorsSHIELD_EXPORTER_FILTER_COLLECTORS |
No | Comma separated collectors to filter. If not set, all collectors will be enabled (Archives, Jobs, RetentionPolicies, Schedules, Status, Stores, Targets, Tasks) |
|
metrics.namespaceSHIELD_EXPORTER_METRICS_NAMESPACE |
No | shield |
Metrics Namespace |
metrics.environmentSHIELD_EXPORTER_METRICS_ENVIRONMENT |
Yes | Environment label to be attached to metrics | |
web.listen-addressSHIELD_EXPORTER_WEB_LISTEN_ADDRESS |
No | :9179 |
Address to listen on for web interface and telemetry |
web.telemetry-pathSHIELD_EXPORTER_WEB_TELEMETRY_PATH |
No | /metrics |
Path under which to expose Prometheus metrics |
web.auth.usernameSHIELD_EXPORTER_WEB_AUTH_USERNAME |
No | Username for web interface basic auth | |
web.auth.passwordSHIELD_EXPORTER_WEB_AUTH_PASSWORD |
No | Password for web interface basic auth | |
web.tls.cert_fileSHIELD_EXPORTER_WEB_TLS_CERTFILE |
No | Path 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_fileSHIELD_EXPORTER_WEB_TLS_KEYFILE |
No | Path to a file that contains the TLS private key (PEM format) |
[1] If your Shield backend uses a self signed certificate, set the SHIELD_SKIP_SSL_VERIFY environment variable to true to skip the SSL verification.
The exporter returns the following Archives metrics:
| Metric | Description | Labels |
|---|---|---|
| metrics.namespace_archives_total | Labeled total number of Shield Archives | environment, backend_name, archive_status, store_plugin, target_plugin |
| metrics.namespace_archives_scrapes_total | Total number of scrapes for Shield Archives | environment, backend_name |
| metrics.namespace_archives_scrape_errors_total | Total number of scrape errors of Shield Archives | environment, backend_name |
| metrics.namespace_last_archives_scrape_error | Whether the last scrape of Archive metrics from Shield resulted in an error (1 for error, 0 for success) |
environment, backend_name |
| metrics.namespace_last_archives_scrape_timestamp | Number of seconds since 1970 since last scrape of Archive metrics from Shield | environment, backend_name |
| metrics.namespace_last_archives_scrape_duration_seconds | Duration of the last scrape of Archive metrics from Shield | environment, backend_name |
The exporter returns the following Jobs metrics:
| Metric | Description | Labels |
|---|---|---|
| metrics.namespace_job_last_run | Number of seconds since 1970 since last run of a Shield Job | environment, backend_name, job_name |
| metrics.namespace_job_next_run | Number of seconds since 1970 until next run of a Shield Job | environment, backend_name, job_name |
| metrics.namespace_job_status | Shield Job status (0 for unknow, 1 for pending, 2 for running, 3 for canceled, 4 for failed, 5 for done) |
environment, backend_name, job_name |
| metrics.namespace_job_pause | Shield Job pause status (1 for paused, 0 for unpaused) |
environment, backend_name, job_name |
| metrics.namespace_jobs_total | Labeled total number of Shield Jobs | environment, backend_name, job_paused, store_plugin, target_plugin |
| metrics.namespace_jobs_scrapes_total | Total number of scrapes for Shield Jobs | environment, backend_name |
| metrics.namespace_jobs_scrape_errors_total | Total number of scrape errors of Shield Jobs | environment, backend_name |
| metrics.namespace_last_jobs_scrape_error | Whether the last scrape of Job metrics from Shield resulted in an error (1 for error, 0 for success) |
environment, backend_name |
| metrics.namespace_last_jobs_scrape_timestamp | Number of seconds since 1970 since last scrape of Job metrics from Shield | environment, backend_name |
| metrics.namespace_last_jobs_scrape_duration_seconds | Duration of the last scrape of Job metrics from Shield | environment, backend_name |
The exporter returns the following Retention Policies metrics:
| Metric | Description | Labels |
|---|---|---|
| metrics.namespace_retention_policies_total | Total number of Shield Retention Policies | environment, backend_name |
| metrics.namespace_retention_policies_scrapes_total | Total number of scrapes for Shield Retention Policies | environment, backend_name |
| metrics.namespace_retention_policies_scrape_errors_total | Total number of scrape errors of Shield Retention Policies | environment, backend_name |
| metrics.namespace_last_retention_policies_scrape_error | Whether the last scrape of Retention Policies metrics from Shield resulted in an error (1 for error, 0 for success) |
environment, backend_name |
| metrics.namespace_last_retention_policies_scrape_timestamp | Number of seconds since 1970 since last scrape of Retention Policies metrics from Shield | environment, backend_name |
| metrics.namespace_last_retention_policies_scrape_duration_seconds | Duration of the last scrape of Retention Policies metrics from Shield | environment, backend_name |
The exporter returns the following Schedules metrics:
| Metric | Description | Labels |
|---|---|---|
| metrics.namespace_schedules_total | Total number of Shield Schedules | environment, backend_name |
| metrics.namespace_schedules_scrapes_total | Total number of scrapes for Shield Schedules | environment, backend_name |
| metrics.namespace_schedules_scrape_errors_total | Total number of scrape errors of Shield Schedules | environment, backend_name |
| metrics.namespace_last_schedules_scrape_error | Whether the last scrape of Schedule metrics from Shield resulted in an error (1 for error, 0 for success) |
environment, backend_name |
| metrics.namespace_last_schedules_scrape_timestamp | Number of seconds since 1970 since last scrape of Schedule metrics from Shield | environment, backend_name |
| metrics.namespace_last_schedules_scrape_duration_seconds | Duration of the last scrape of Schedule metrics from Shield | environment, backend_name |
The exporter returns the following Status metrics:
| Metric | Description | Labels |
|---|---|---|
| metrics.namespace_status_pending_tasks_total | Total number of Shield pending Tasks | environment, backend_name |
| metrics.namespace_status_running_tasks_total | Total number of Shield running Tasks | environment, backend_name |
| metrics.namespace_status_schedule_queue_total | Total number of Shield Tasks in the supervisor scheduler queue | environment, backend_name |
| metrics.namespace_status_run_queue_total | Total number of Shield Tasks in the supervisor run queue | environment, backend_name |
| metrics.namespace_status_scrapes_total | Total number of scrapes for Shield Status | environment, backend_name |
| metrics.namespace_status_scrape_errors_total | Total number of scrape errors of Shield Status | environment, backend_name |
| metrics.namespace_last_status_scrape_error | Whether the last scrape of Status metrics from Shield resulted in an error (1 for error, 0 for success) |
environment, backend_name |
| metrics.namespace_last_status_scrape_timestamp | Number of seconds since 1970 since last scrape of Status metrics from Shield | environment, backend_name |
| metrics.namespace_last_status_scrape_duration_seconds | Duration of the last scrape of Status metrics from Shield | environment, backend_name |
The exporter returns the following Stores metrics:
| Metric | Description | Labels |
|---|---|---|
| metrics.namespace_stores_total | Labeled total number of Shield Stores | environment, backend_name, store_plugin |
| metrics.namespace_stores_scrapes_total | Total number of scrapes for Shield Stores | environment, backend_name |
| metrics.namespace_stores_scrape_errors_total | Total number of scrape errors of Shield Stores | environment, backend_name |
| metrics.namespace_last_stores_scrape_error | Whether the last scrape of Store metrics from Shield resulted in an error (1 for error, 0 for success) |
environment, backend_name |
| metrics.namespace_last_stores_scrape_timestamp | Number of seconds since 1970 since last scrape of Store metrics from Shield | environment, backend_name |
| metrics.namespace_last_stores_scrape_duration_seconds | Duration of the last scrape of Store metrics from Shield | environment, backend_name |
The exporter returns the following Targets metrics:
| Metric | Description | Labels |
|---|---|---|
| metrics.namespace_targets_total | Labeled total number of Shield Targets | environment, backend_name, target_plugin |
| metrics.namespace_targets_scrapes_total | Total number of scrapes for Shield Targets | environment, backend_name |
| metrics.namespace_targets_scrape_errors_total | Total number of scrape errors of Shield Targets | environment, backend_name |
| metrics.namespace_last_targets_scrape_error | Whether the last scrape of Target metrics from Shield resulted in an error (1 for error, 0 for success) |
environment, backend_name |
| metrics.namespace_last_targets_scrape_timestamp | Number of seconds since 1970 since last scrape of Target metrics from Shield | environment, backend_name |
| metrics.namespace_last_targets_scrape_duration_seconds | Duration of the last scrape of Target metrics from Shield | environment, backend_name |
The exporter returns the following Tasks metrics:
| Metric | Description | Labels |
|---|---|---|
| metrics.namespace_tasks_total | Labeled total number of Shield Tasks | environment, backend_name, task_operation, task_status |
| metrics.namespace_tasks_duration_seconds | Labeled summary of Shield Task durations in seconds | environment, backend_name, task_operation, task_status |
| metrics.namespace_tasks_scrapes_total | Total number of scrapes for Shield Tasks | environment, backend_name |
| metrics.namespace_tasks_scrape_errors_total | Total number of scrape errors of Shield Tasks | environment, backend_name |
| metrics.namespace_last_tasks_scrape_error | Whether the last scrape of Task metrics from Shield resulted in an error (1 for error, 0 for success) |
environment, backend_name |
| metrics.namespace_last_tasks_scrape_timestamp | Number of seconds since 1970 since last scrape of Task metrics from Shield | environment, backend_name |
| metrics.namespace_last_tasks_scrape_duration_seconds | Duration of the last scrape of Task metrics from Shield | environment, backend_name |
Refer to the contributing guidelines.
Apache License 2.0, see LICENSE.
