Coder Social home page Coder Social logo

librato's Introduction

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/librato

spaces:
  -
    name: Space 1
    order:
      - chart_1
      - chart_2
      - chart_3

accounts:
  name_1:
    user: [email protected]
    token: token_1
    vars:
      app: app_1
      db_name: foo

  name_2:
    user: [email protected]
    token: token_2
    vars:
      app: app_2
      db_name: bar

librato's People

Contributors

svenfuchs avatar

Watchers

James Cloos avatar Robin Chowdhury avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.