libhoney_ex v0.1.0 Libhoney.Event View Source

Provides functions for manipulating Event structs.

Link to this section Summary

Functions

Returns an Event struct with a key/value pair added to the fields.

Returns an Event struct. All parameters are optional and will be defaulted to those set in the mix config.

Link to this section Functions

Link to this function

add_field(event, key, value)

View Source

Returns an Event struct with a key/value pair added to the fields.

iex> evt = Libhoney.Event.create("apples", "pears", "http://api.honeycomb.io", 1, 1512482945)
iex> evt |> Libhoney.Event.add_field("name", "Rick Anchez")
%Libhoney.Event{api_host: "http://api.honeycomb.io", dataset: "pears",
  fields: %{"name" => "Rick Sanchez"}, sample_rate: 1, timestamp: 1512482945, write_key: "apples"}
Link to this function

create(write_key, dataset)

View Source
Link to this function

create(write_key, dataset, api_host)

View Source
Link to this function

create(write_key, dataset, api_host, sample_rate)

View Source
Link to this function

create(write_key, dataset, api_host, sample_rate, timestamp)

View Source

Returns an Event struct. All parameters are optional and will be defaulted to those set in the mix config.

iex> Libhoney.Event.create("apples", "pears", "http://api.honeycomb.io", 1, 1512482945)
%Libhoney.Event{api_host: "http://api.honeycomb.io", dataset: "pears",
  fields: %{}, sample_rate: 1, timestamp: 1512482945, write_key: "apples"}