Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ehigham/terra-workspace-metrics
Print Google Cloud Storage metrics for buckets associated with Terra workspaces.
https://github.com/ehigham/terra-workspace-metrics
Last synced: 14 days ago
JSON representation
Print Google Cloud Storage metrics for buckets associated with Terra workspaces.
- Host: GitHub
- URL: https://github.com/ehigham/terra-workspace-metrics
- Owner: ehigham
- License: bsd-3-clause
- Created: 2022-11-23T20:18:42.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-11-29T15:49:14.000Z (about 2 years ago)
- Last Synced: 2024-12-03T16:47:20.783Z (about 1 month ago)
- Language: Haskell
- Size: 30.3 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# terra-bucket-metrics
Print Google Cloud Storage metrics for buckets associated with Terra workspaces.The following metrics are supported:
- storage.googleapis.com/storage/object_count
- storage.googleapis.com/storage/total_bytes# Quick Start
If you're new to Haskell, don't worry - it's a glorious world where we humbly
offer programs to our glorious leader, Simon Peyton Jones. You are most welcome.## Requirements
- [stack](https://docs.haskellstack.org/en/stable/), A Haskell build tool
- An installation of an implementation of the C mysqlclient API, like [mariadb](https://mariadb.org/)## Getting Stack
The simplest way to start off building and using Haskell programs with
stack (avoiding questionable decisions some linux distributions make about
packaging haskell libraries) is to install [ghcup](https://www.haskell.org/ghcup/)
and follow the instructions to install the recommended stack and cabal binaries.## Building
After you've cloned this repository and installed `stack`, `cd` into
`terra-bucket-metrics` and run
```
$ stack build
```This will install a compatible version of GHC (the Glasgow Haskell Compiler),
fetch and build dependencies and then compile the program. Optionally, you can
run `stack install` afterwards to install the binary to your local bin path
(see output of `stack path --local-bin`).## Usage
See output of
```
$ terra-workspace-metrics --help
```Note:
- You need to define the `VAULT_ADDR` environment variable in the form
`https://hostname:port` and have a valid vault token at `$HOME/.vault-token`.
- When scrutinising all workspaces in a particluar environment (via `--all`),
you should use service account credentials instead of your own. `curl` down
these service account credentials and run the program this way:```
$ GOOGLE_APPLICATION_CREDENTIALS=/path/to/credentials.json terra-workspace-metrics -e ENVIRONMENT --all
```