https://github.com/hsdp/cfprom
Prometheus metrics for CPU/Memory usage of apps deployed in a Cloud foundry space
https://github.com/hsdp/cfprom
cloudfoundry prometheus-metrics
Last synced: 30 days ago
JSON representation
Prometheus metrics for CPU/Memory usage of apps deployed in a Cloud foundry space
- Host: GitHub
- URL: https://github.com/hsdp/cfprom
- Owner: hsdp
- License: apache-2.0
- Archived: true
- Created: 2018-04-23T07:28:08.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2020-01-21T05:38:42.000Z (about 6 years ago)
- Last Synced: 2025-11-18T12:11:27.987Z (3 months ago)
- Topics: cloudfoundry, prometheus-metrics
- Language: Go
- Size: 427 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cfprom
Prometheus metrics for CPU/Memory usage of apps deployed in a Cloud foundry space
# Building
## Requirements
- [Go 1.11 or newer](https://golang.org/doc/install)
## 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 the `PASSWORD` environment is 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./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.