Skip to content

Finbits/telegraf-elixir

Repository files navigation

Telegraf

Telegraf client.

Hex.pm Version CI codecov

Checkout the documentation for more information.

Installation

The package can be installed by adding telegraf to your list of dependencies in mix.exs:

def deps do
  [
    {:telegraf, "~> 0.1.1"}
  ]
end

Usage

  1. Add Telegraf to your supervision tree:
{Telegraf, name: MyTelegraf}
  1. Send the metric:
metric = %Telegraf.Metric{
  name: "weather",
  tag_set: %{location: "us-midwest"},
  field_set: %{temperature: 82},
  timestamp: System.os_time()
}

Telegraf.send(MyTelegraf, metric)

Changelog

See the changelog.

Contributing

See the contributing file.

License

Copyright 2021 (c) Finbits.

telegraf-elixir source code is released under Apache 2 License.

Check LICENSE file for more information.