Skip to content

A client for interacting with honeycomb.io

Notifications You must be signed in to change notification settings

Driftrock/libhoney-ex

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

libhoney_ex

A library for interacting with the honeycomb.io API, built against the SDK requirements posted by honeycomb.

Installation

If available in Hex, the package can be installed by adding libhoney_ex to your list of dependencies in mix.exs:

def deps do
  [
    {:libhoney_ex, "~> 0.2.0"}
  ]
end

Usage

Events

Constructing an event

alias Libhoney.Event

event = Event.create(write_key: "write_key", dataset: "requests")
event =
  event
  |> Event.add_field("name", "Rick Sanchez")
  |> Event.add_field("earth_dimension", 137)

Sending an event

alias Libhoney.Event

Event.create(write_key: "write_key", dataset: "requests")
|> Libhoney.send_event

Markers

Markers are not part of the minimum spec, and haven't been added yet.

Configuration

For now libhoney_ex allows you to configure any global settings via application config.

In your config.exs or config/[env].exs:

config :libhoney_ex, api_host: "https://api.honeycomb.io"
config :libhoney_ex, dataset: "requests"
config :libhoney_ex, write_key: "lemons"
config :libhoney_ex, sample_rate: 1

Both api_host and sample_rate will use the required defaults specified by honeycomb.io, however if dataset or write_key are not provided, attempts to contact the API will result in an error.

About

A client for interacting with honeycomb.io

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages

  • Elixir 100.0%