All Projects → palkan → influx_udp

palkan / influx_udp

Licence: MIT license
Erlang InfluxDB UDP writer

Programming Languages

erlang
1774 projects
Makefile
30231 projects

Labels

Projects that are alternatives of or similar to influx udp

docker-telegraf-influxdb-grafana
Docker Image with Telegraf, InfluxDB and Grafana
Stars: ✭ 17 (-41.38%)
Mutual labels:  influxdb
influxdb-cxx
Fork of the unmaintained https://github.com/awegrzyn/influxdb-cxx project.
Stars: ✭ 47 (+62.07%)
Mutual labels:  influxdb
darksky-influxdb
Logs weather information from darksky.io to InfluxDB
Stars: ✭ 22 (-24.14%)
Mutual labels:  influxdb
grafana-dashboards
List of Grafana Dashboards 📺
Stars: ✭ 120 (+313.79%)
Mutual labels:  influxdb
inspector-metrics
Typescript metrics / monitoring library
Stars: ✭ 19 (-34.48%)
Mutual labels:  influxdb
bounded-disturbances
A k6/.NET red/green load testing workshop
Stars: ✭ 39 (+34.48%)
Mutual labels:  influxdb
continuous-analytics-examples
A collection of examples of continuous analytics.
Stars: ✭ 17 (-41.38%)
Mutual labels:  influxdb
influx-query-builder
The super lightweight InfluxDB query builder implemented in Go
Stars: ✭ 16 (-44.83%)
Mutual labels:  influxdb
dropwizard-influxdb-reporter
Dropwizard Integrations for InfluxDB.
Stars: ✭ 16 (-44.83%)
Mutual labels:  influxdb
telegraf-influxdb-grafana
TIG Stack
Stars: ✭ 30 (+3.45%)
Mutual labels:  influxdb
telemetry collector
build telemetry software stack for Cisco nx-os, support both telemetry dial-out and gNMI dial-in
Stars: ✭ 39 (+34.48%)
Mutual labels:  influxdb
influxdb-cxx
C++ client library for InfluxDB 1.x/2.x
Stars: ✭ 69 (+137.93%)
Mutual labels:  influxdb
influxdb-ha
High-availability and horizontal scalability for InfluxDB
Stars: ✭ 45 (+55.17%)
Mutual labels:  influxdb
monitoring-rancher
🤠How to Set up Rancher Server Monitoring with TIG Stack?
Stars: ✭ 22 (-24.14%)
Mutual labels:  influxdb
mongofluxd
Real time sync from MongoDB into InfluxDB
Stars: ✭ 33 (+13.79%)
Mutual labels:  influxdb
envsensor-observer-py
Python Bluetooth low energy observer example for OMRON Environment Sensor (2JCIE-BL01)
Stars: ✭ 31 (+6.9%)
Mutual labels:  influxdb
monitor system docs
No description or website provided.
Stars: ✭ 30 (+3.45%)
Mutual labels:  influxdb
odata-influxdb
An OData compliant API for accessing data stored in influxdb
Stars: ✭ 28 (-3.45%)
Mutual labels:  influxdb
nfCollector
Collects Netflow version 1, 5, 6, 7, 9 & IPFIX & stores them on InfluxData time-series DB (InfluxDB)
Stars: ✭ 30 (+3.45%)
Mutual labels:  influxdb
influx-proxy
InfluxDB Proxy with High Availability and Consistent Hash
Stars: ✭ 223 (+668.97%)
Mutual labels:  influxdb

Build Hex Version

Erlang InfluxDB UDP Writer

Write data to InfluxDB (>= 0.9) via UDP (see InfluxDB docs).

Erlang/OTP version: >=17.1

Setup

rebar.config

%% using Hex
{deps, [
  influx_udp
]}.

%% from source
{deps, [
  {influx_udp, ".*", {git, "https://github.com/palkan/influx_udp.git", "master"}}
]}.

app.config

[
  {influx_udp,
    [
      {influx_host, '127.0.0.1'},
      {influx_port, 8089},
      {pool_size, 5}, %% defaults to 3
      {max_overflow, 10} %% defaults to 1
    ]
  }
].

Usage

First, you need to start the application:

influx_udp:start().

Now you can create pools and write data to InfluxDB.

Pools

The default pool is started on application start if you specified influx_host and influx_port in the configuration file (see above).

You can run pools manually:

influx_udp:start_pool(my_pool, #{ host => 'yet.another.influx.host' }).

Options not specified in influx_udp:start_pool/2 would be taken from the default configuration.

Writing data

%% Writing to the named pool with tags
influx_udp:write_to(
  my_pool,
  Series::string()|atom()|binary(), Points::list(map())|list(proplists:proplist())|map()|proplists:proplist(),
  Tags::proplists:proplist()|map()).

influx_udp:write_to(my_pool, "cpu", [{value, 88}], [{host, 'eu-west'}]).

%% Writing to default pool
influx_udp:write("cpu", [#{value => 88}, #{value => 22}, #{value => 33}], [{host, 'eu-west'}]).

%% Writing data with time
influx_udp:write("cpu", #{value => 88}, #{host => 'eu-west'}, 1434055562000000000).

%% or with current time
influx_udp:write("cpu", #{value => 88}, #{host => 'eu-west'}, true).

%% Writing to default pool without tags
influx_udp:write(Series, Points).

%% Writing raw valid InfluxDB input data
influx_udp:write(Data::binary()).

%% or
influx_udp:write_to(my_pool, Data::binary()).

%% Write Influx-valid map or proplist
influx_udp:write(#{ measurement => test, fields => #{ val => 1} }).

%% or many points
influx_udp:write(
  #{ measurement => test, fields => #{ val => 1} },
  #{ measurement => test2, fields => #{ val => 2}, tags => { host => test}}
)

Encoder

Module influx_line provides methods to encode erlang terms to Line protocol. Encoder automatically sets timestamps (unique) when encoding list of points (see below).

%% convert map or proplist to line
influx_line:encode(#{ measurement => test, fields => #{ val => 1} }).

#=> <<"test val=1">>

%% convert list of points to lines
influx_line:encode([
  #{ measurement => test, fields => #{ val => 1} },
  #{ measurement => test2, fields => #{ val => 2}, tags => { host => test}}
]).

#=> <<"test val=1 1434305562895000000\ntest2,host=test val=2 1434305562895000001">>

%% convert any map/proplist to line
influx_line:encode(test, #{ val => 1}).

#=> <<"test val=1">>

%% convert many points with the same measurement and tags to line
influx_line:encode(test, [#{ val => 1}, #{ val => 2}], #{ host => test}, 100).

#=> <<"test,host=test val=1 100\ntest,host=test val=2 101\n">>

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/palkan/influx_udp.

License

The library is available as open source under the terms of the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].