Code Monkey home page Code Monkey logo

exometer_graphite's Introduction

The exometer_graphite application

Build Status

This application pushes Exometer metrics to a Graphite server. Also, the application allows selection of relevant Exometer metrics that are created already or will be created in future.

Before sending, metrics are stored in configurable time interval buffer and sent to Carbon (Graphite backend) using Pickle protocol.

This application configured in sys.config file.

Configuration items:

  • host - address of a Graphite server. Default is "localhost"
  • port - port of Carbon receiving Pickle protocol messages. Default is 2004.
  • send_delay - time interval buffer of storing metrics before sending to Graphite. Default is 10 seconds.
  • connect_timeout - connection to Carbon timeout. In case connection cannot be established, this application retries specified number of times. After unsuccessful retries single send_delay interval loop is finished with pending messages for the next loop. Default is 5 seconds.
  • retries - how many times to try sending messages to Graphite in single send_delay interval loop. number of retries when sending messages to Carbon on the same socket. Default is 2.
  • resub_delay - time interval of renewing subscriptions. New metrics can be created or deleted. Default is 60 seconds.
  • path_prefix - adds prefix for metrics that are sent to graphite. To automatically get node@host, use atom '$node' which provides erlang:node/0
  • force_sname - forces the use of short names when passing $node as the prefix eg. [email protected] would be converted to node@host
  • period_replacement - What character to use to replace periods in the graphite path when using $node. defaults to '~'.
  • subscriptions - selection of metrics that are wanted to be seen in Graphite. Read next section for detail information.

Selecting metrics is done using Erlang specification matching.

Note that subscription entries are scanned in order, and first match wins. In case an application creates new metrics in runtime, subscriptions are renewed every resubscription_delay,

Top-level generic expresion of a subscription configuration:

{subscriptions, [
    subscription(),
    ...
]}
subscription() = {
                     [
                         {name_pattern(), type()},
                         ...
                     ],
                     datapoint_setting(),
                     interval()
                 }
name_pattern() = [name_part()]

Atom '_' is expression for any.

type() = '_' | counter | fast_counter | gauge | histogram | spiral | duration | meter

Atom '_' is expression for any.

name_part() = '_' | atom() | integer()
    {exometer_graphite, [
        {host, "localhost"},
        {port, 2004},
        {connect_timeout, 5000},
        {send_delay, 3000},
        {retries, 2},
        {resub_delay, 60000},
        {path_prefix, [server1, '$node']},
        {subscriptions, [
            {
                [
                    {[program1,   lager, '_'], '_'},
                    {[program2, lager, '_'], '_'}
                ],
                [mean, max, min],
                20000
            },
            {
                [{[program2, store, '_'], histogram}],
                all,
                10000},
            {
                [{[program3, lager, '_'], '_'}],
                [mean, min, max],
                4000
            },
            {
                [{[program4 | '_'], '_'}],
                all,
                5000
            }
        ]}
    ]},
    {exometer_core, [
        {report, [
            {reporters, [
                {exometer_graphite_reporter, []}
            ]}
        ]}
    ]}

Following name_pattern() will select all available metrics with name starting with program1:

    [program1 | '_']

To check if metrics are sent to Graphite server, in test/sys.config set {port, 2004} instead of {port, 8096} and run make itest. Test will fail. Metrics testA.cpuUsage.value and testB.memUsage.min should appear in Graphite.

To remove these metrics run following command:

sudo rm -r /var/lib/graphite/whisper/server1/

Modules

exometer_graphite_app
exometer_graphite_reporter
exometer_graphite_subscribers
exometer_graphite_sup

exometer_graphite's People

Contributors

k32 avatar kape1395 avatar zugolosian avatar

Watchers

 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.