Coder Social home page Coder Social logo

hatman's Introduction

Stathat + Statman

This library pushes your metrics collected with statman to stathat.

Statman metrics maps to stathat data points in the following way:

  • histogram -> value
  • counter -> count
  • gauge -> value

Statman keys are flattened and join with a "/", e.g {my, key} to "my/key".

Pretty much a carbon copy of newrelic-erlang.

Configuration

Your stathat ez_key needs to be set as an application environment variable for the hatman app.

You may also explicitly whitelist stats by setting the whitelist application environment variable for the hatman app. If the whitelist is undefined all metrics are sent to stathat.

So an example config would be something like this (whitelist is optional, if undefined it means all statman keys are considered whitelisted):

> application:get_env(hatman, ez_key).
{ok, "[email protected]"}.
> application:get_env(hatman, whitelist).
{ok, [{db, write_latency}, {db, read_latency}, <<"some_other_statman_key">>]}.

To get started and configuring which polling function to use, do this:

application:set_env(hatman, ez_key, "[email protected]").
application:start(hatman).
statman_aggregator:start_link().
hatman_poller:start_link(fun hatman_statman:poll/1).

To test that hatman works, do this:

application:start(hatman).
EzKey = "[email protected]".
hatman_stathat:ez_json(EzKey, hatman_stathat:sample_stats()).

Extending hatman

I only need it for statman but if you get your metrics from some other tool it should be fairly easy to plug in your on poll function which formats your data for stathat. Check out how formating is done in hatman_statman.erl.

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.