cfprom

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2018 License: Apache-2.0 Imports: 12 Imported by: 0

README

cfprom

Prometheus metrics for CPU/Memory usage of apps deployed in a Cloud foundry space

Building

Requirements

Compiling

Clone the repo somewhere (preferably outside your GOPATH):

$ git clone git@github.com:hsdp/cfprom
$ cd cfprom
$ go build .

This produce a logproxy binary exectable read for use

Docker

Alternatively, you can use the included Dockerfile to build a docker image which can be deployed to CF directly.

$ git clone git@github.com:hsdp/cfprom
$ cd cfprom
$ docker build -t cfprom .

Usage

Deploy cfprom to any CF space and it will create a Prometheus /metrics endpoint which can be scraped. It uses the CF API to fetch statistics on all running applications. Currently it requires credentials of a CF account with the Auditor role or better.

Configuration

The following environment variables are used

Variable Required Description
CF_USERNAME N The CF login to use
CF_PASSWORD N The CF password to use
PASSWORD N The cfprom password

Authentication

When PASSWORD environment variables are set both the /metrics and /bootstrap endpoint will be protected by Basic Authentication. The username is always cfprom

Bootstrapping

If you do not wish to add CF_USERNAME and CF_PASSWORD to the environment you can bootstrap cfprom by posting the username and password to the /bootstrap endpoint:

curl -X POST https://cfprom.<your_cf_domain>/bootstrap -d '{"username":"admin","password":"SuperS3cret"}'

Only after sending the correct credentials will cfprom be able to start collecting metrics. Note that this a tradeoff between security and convenience. You will have to bootstrap again if cfprom gets restarted or restaged for whatever reason.

License

Apache. Also see the NOTICE file.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL