README
¶
Credhub Prometheus Exporter 
A Prometheus exporter for Credhub.
Installation
Binaries
Download the already existing binaries for your platform:
$ ./credhub_exporter <flags>
From source
Using the standard go install (you must have Go already installed in your local machine):
$ go install github.com/orange-cloudfoundry/credhub_exporter
$ credhub_exporter <flags>
Docker
To run the credhub exporter as a Docker container, run:
$ docker run -p 9358:9358 orangeopensource/credhub-exporter <flags>
Usage
UAA Client
In order to connect to the Credhub API a client-id and client-secret must be provided. The client-id must have the creadhub.read authority.
For example, to create a new client-id and client-secret with the right permissions:
uaac target https://<YOUR UAA URL> --skip-ssl-validation
uaac token client get <YOUR ADMIN CLIENT ID> -s <YOUR ADMIN CLIENT SECRET>
uaac client add prometheus-credhub \
--name prometheus-credhub \
--secret prometheus-credhub-client-secret \
--authorized_grant_types client_credentials,refresh_token \
--authorities creadhub.read
Flags
| Flag / Environment Variable | Required | Default | Description |
|---|---|---|---|
credhub.api_urlCREDHUB_EXPORTER_API_URL |
Yes | Credhub API URL | |
credhub.client-idCREDHUB_EXPORTER_CLIENT_ID |
Yes | Credhub Client ID (must have the credhub.read scope) |
|
credhub.client-secretCREDHUB_EXPORTER_CLIENT_SECRET |
Yes | Credhub Client Secret | |
credhub.proxyCREDHUB_EXPORTER_PROXY |
No | Socks proxy to open before connecting to credub | |
credhub.ca-certs-pathCREDHUB_EXPORTER_CA_CERTS_PATH |
No | Path to CA certificate to use when connecting credhub | |
filters.generic-certificatesCREDHUB_EXPORTER_GENERIC_CERTIFICATES |
No | [] |
Json list of to match generic credentials paths that may contains certificates |
metrics.director-nameCREDHUB_EXPORTER_METRICS_DIRECTOR |
Yes | bosh |
Director label to be attached to metrics |
metrics.namespaceCREDHUB_EXPORTER_METRICS_NAMESPACE |
No | credhub |
Metrics Namespace |
metrics.environmentCREDHUB_EXPORTER_METRICS_ENVIRONMENT |
Yes | Environment label to be attached to metrics | |
skip-ssl-verifyCREDHUB_EXPORTER_SKIP_SSL_VERIFY |
No | false |
Disable SSL Verify |
web.listen-addressCREDHUB_EXPORTER_WEB_LISTEN_ADDRESS |
No | :9358 |
Address to listen on for web interface and telemetry |
web.telemetry-pathCREDHUB_EXPORTER_WEB_TELEMETRY_PATH |
No | /metrics |
Path under which to expose Prometheus metrics |
web.auth.usernameCREDHUB_EXPORTER_WEB_AUTH_USERNAME |
No | Username for web interface basic auth | |
web.auth.passwordCREDHUB_EXPORTER_WEB_AUTH_PASSWORD |
No | Password for web interface basic auth | |
web.tls.cert_fileCREDHUB_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_fileCREDHUB_EXPORTER_WEB_TLS_KEYFILE |
No | Path to a file that contains the TLS private key (PEM format) |
Metrics
The exporter returns the following Applications metrics:
| Metric | Description | Labels |
|---|---|---|
| metrics.namespace_credential_created_at | Unix timestamp of the creation of the last version of given credential | director, environment, id, name, path |
| metrics.namespace_certificate_expires_at | Unix timestamp of the expire time of the certificate | director, environment, id, name, path, index |
| metrics.namespace_last_scrap_error | Number of credential that exporter failed read during last scrape | director, environment |
Contributing
Refer to the contributing guidelines.
License
Apache License 2.0, see LICENSE.
Documentation
¶
There is no documentation for this package.
Click to show internal directories.
Click to hide internal directories.