GithubHelp home page GithubHelp logo

exometer_influxdb's Introduction

Exometer InfluxDB reporter Build Status

This reporter pushes data to InfluxDB.

Usage

  1. Add exometer_influxdb to your list of dependencies in rebar.config:

    {deps, [
        {exometer_influxdb, ".*", {git, "https://github.com/travelping/exometer_influxdb.git", "master"}}
    ]}.
  2. Ensure exometer_influxdb is started before your application:

    {applications, [exometer_influxdb]}.
  3. Configure it:

    {exometer, 
        {reporters, [
            {exometer_report_influxdb, [{protocol, http}, 
                                        {host, <<"localhost">>},
                                        {port, 8086},
                                        {db, <<"exometer">>},
                                        {tags, [{region, ru}]}]}
        ]}
    }.

Available options:

  • host - InfluxDB host. 127.0.0.1 by default.
  • protocol - http or udp for operating with InfluxDB. http by default.
  • port - InfluxDB port. 8086 by default.
  • db - database on InfluxDB for writing data. exometer by default
  • username - username for authorization on InfluxDB.
  • password - password for authorization on InfluxDB.
  • timestamping - enable timestamping, false by default.
  • tags - list of default tags for each data point. The host is automatically included here.
  • batch_window_size - set window size in ms for batch sending. This means reported will collect measurements within this interval and send all measurements in one packet. 0 by default.

Timestamping is by default done by influxdb itself. To enable timestamping with the reporter you can use true or {true, Precision} where Precision is a unit taken from [n,u,ms,s,m,h]. The default unit is u.

Besides the tags for the reporter initialization it is possible to add other tags via the Extra parameter of exometer_report:subscribe/5 as done here with environment variables:

{exometer, 
    {subscriptions, [
         {exometer_report_influxdb, [erlang, memory], total, 5000, true, [{tag, <<"value">>}]},
    ]}
}.

By default the in influxdb visible name of the metric is derived from the exometer id: here [erlang, memory] is translated to erlang_memory. It is possible to remove an item from this list by naming itself or its position with the from_name keyword. A removed element is then used as tag:

exometer_report:subscribe(exometer_report_influxdb, [erlang, memory], total, 5000, true, [{tag, {from_name, 2}}]).

This will result in a name erlang with the tag pair {tag, memory} (plus the default pair {host, Host}).

TODO

  • Tests
  • Reconfiguration on runtime

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.