Telegraf (Telegraf v0.1.1) View Source
Telegraf client.
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"}
]
endUsage
- Add
Telegrafto your supervision tree:
{Telegraf, name: MyTelegraf}- 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.
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor.
Sends a metric to the telegraf daemon
Starts a Telegraf supervisor.
Link to this section Types
Specs
name() :: atom()
Name of the telegraf instance.
Link to this section Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Specs
Sends a metric to the telegraf daemon
metric = %Telegraf.Metric{
name: "weather",
tag_set: %{location: "us-midwest"},
field_set: %{temperature: 82},
timestamp: System.os_time()
}
Telegraf.send(MyTelegraf, metric)
Starts a Telegraf supervisor.
Supported options
:name- Required. Name of the telegraf instance.:transport- A module implementingTelegraf.Transportbehaviour. The default value isTelegraf.Transport.UnixSocket.:transport_options- Options passed to the transport adapter. Checkout each transport adapter docs for a detailed description of the options. The default value is[].:serializer- A module implementingTelegraf.Serializerbehaviour. The default value isTelegraf.Serializer.LineProtocol.