Home

Awesome

Libraclips

Heroku Dataclips 2 Librato Tracker

This project aims to allow you to follow dataclips to be tracked on Librato. You can specify the base librato namespace of the metric and also the interval in which it has to be measured.

DISCLAIMER If you are not lucky enough to have your database hosted at Heroku, Please take a look to @mmcgrana Go implementation to attack directly the database and export to librato : mmcgrana/pg2librato

Setup

$ bundle install
$ mv .env.example .env
$ $EDITOR .env  # set your env variables
$ psql -d d2l # or heroku pg:psql
psql > \i db/schema.rb
psql > \q
$ foreman start -p 3000

Differents ENV variables

Example of possible dataclips output that work actually

Simple value

Metrics created

One named by the metric name. Here:

Column with name + value

Metrics created

One for each line. Here:

Matching based on column name (Here we export each column to a separate metric)

Metrics created

One of each per line. Named <metric_name>.<line_title>.<metric_type>

How to extend the possible transformations

Adding a new class under D2L::TransformFunctions. This class just needs to implements two methods

Class skeleton

module D2L
  module TransformFunctions
    class MyTransform < Base
      def accepts?(dataclip)
        # check if your function can handle the clip
        true
      end

      def transform
        # do amazing stuff with the dataclip
      end
    end
  end
end

Web Interface

You can browse localhost:3000 to have a small API over this. Default username and password : 'changeme'

Endpoints

TODO