This project aims to provide an easy way to expose some resource usage about a tsuru installation. The project contains an Procfile and this code can be ran as an application on tsuru.
This app will expose usage metrics on a /metrics
endpoint. Two main metrics are available:
tsuru_usage_units{app="apptest",plan="autogenerated",pool="theonepool"} 5
tsuru_usage_nodes{pool="theonepool"} 2
- Create a go application on tsuru
- Deploy this entire repo to tsuru
- Set
USAGE_USER_TOKEN
environment on the app passing a token that has at least the following permissions (with global context):- app.read
- node.read
- Set
API_HOST
environment variable to tsuru-usage API host address (ex:http://localhost:8888
) - Set
PROMETHEUS_HOST
environment variable to your Prometheus server address - Set
MONGODB_URL
andMONGODB_DATABASE_NAME
variables to your MongoDB server credentials - Set in
USAGE_SERVICES
a comma-separated list of services you want Prometheus to monitor - To add basic HTTP authentication to the admin section, set
ADMIN_USERNAME
andADMIN_PASSWORD
environment variables