Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/svenfuchs/librato
Librato client for storing and synchronizing spaces
https://github.com/svenfuchs/librato
Last synced: 13 days ago
JSON representation
Librato client for storing and synchronizing spaces
- Host: GitHub
- URL: https://github.com/svenfuchs/librato
- Owner: svenfuchs
- License: mit
- Created: 2015-10-02T12:22:48.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-09-01T18:05:13.000Z (over 8 years ago)
- Last Synced: 2024-04-24T23:41:00.834Z (8 months ago)
- Language: Ruby
- Size: 12.7 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: MIT-LICENSE
Awesome Lists containing this project
README
# Librato Sync
Minimalistic library that might be a temporary, throw-away project.
It has been published on RubyGems as `librato` since that gem name was unused.
Consider this friendly-squatting, I'll hand it over to Librato on request.It does two things:
* Pull a space from a Librato account, and store JSON data in a local
directory.
* Push the space to a Librato account, from the JSON data stored locally.I use this for these purposes:
* Fetch a space, review its definition for inconsistencies, edit it locally,
and push it back up to Librato.
* Fetch a space from one account, and push a copy of it to another account.
* Copy charts from one space to another, and edit definitions locally.Uses a config file `.librato.yml` if present. The config file name, and the
data directory can be specified as command line options.Usage:
```
$ librato pull [account]
$ librato pull [account] --space "Space 1" --space "Space 2" --config librato.yml --dir ./librato
$ librato push [account]
$ librato push [account] --space "Space 1" --space "Space 2" --config librato.yml --dir ./librato
```Account credentials (user/email and token) can be be included in the config
file, or set as env vars per account:```
export LIBRATO_USER_ACCOUNT_1=[email]
export LIBRATO_TOKEN_ACCOUNT_1=[token]
```The Librato API returns charts in an unordered fashion. You can work around
this by specifying a chart order in the config file.Certain keys and names will be uniq to one account, and need to be changed for
another account. Account configuration can therefor specify variable names and
values. Variable names will be replaced with the value specific to the account
when pushing a space to an account.A full config file has this structure. Each bit of configuration is optional,
but the chart order and template vars cannot be specified via command line
options.```
dir: ./var/libratospaces:
-
name: Space 1
order:
- chart_1
- chart_2
- chart_3accounts:
name_1:
user: [email protected]
token: token_1
vars:
app: app_1
db_name: fooname_2:
user: [email protected]
token: token_2
vars:
app: app_2
db_name: bar
```