Skip to content

tsuru/tsuru-usage

Repository files navigation

Tsuru Usage

Build Status

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

Installing and Running

  1. Create a go application on tsuru
  2. Deploy this entire repo to tsuru
  3. 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
  4. Set API_HOST environment variable to tsuru-usage API host address (ex: http://localhost:8888)
  5. Set PROMETHEUS_HOST environment variable to your Prometheus server address
  6. Set MONGODB_URL and MONGODB_DATABASE_NAME variables to your MongoDB server credentials
  7. Set in USAGE_SERVICES a comma-separated list of services you want Prometheus to monitor
  8. To add basic HTTP authentication to the admin section, set ADMIN_USERNAME and ADMIN_PASSWORD environment variables

About

Resource usage exporter for tsuru

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages