opencensus_honeycomb v0.3.0 Opencensus.Honeycomb

In-process OpenCensus trace exporter for Honeycomb.

Installation

Add :opencensus_honeycomb to your deps in mix.exs, alongside :opencensus:

{:opencensus, "~> 0.9.2"},
{:opencensus_honeycomb, "~> 0.1"}

Read the documentation for Opencensus.Honeycomb.Event for important information on span attribute name and value limitations.

Configuration

Out of the box, we supply a default value for everything except write_key. To override the defaults, set the application environment for :opencensus_honeycomb in config/config.exs using keys from Opencensus.Honeycomb.Config.t/0, as below:

config :opencensus,
  reporters: [{Opencensus.Honeycomb.Reporter, []}],
  send_interval_ms: 1000

config :opencensus_honeycomb,
  dataset: "opencensus",
  service_name: "your_app",
  write_key: System.get_env("HONEYCOMB_WRITEKEY")

Telemetry

Opencensus.Honeycomb.Sender.send_batch/1 calls :telemetry.execute/3 before and after sending events. See Opencensus.Honeycomb.Sender for details.

To watch from your console or remote_console while troubleshooting:

alias Opencensus.Honeycomb.Sender
handle_event = fn n, measure, meta, _ -> IO.inspect({n, measure, meta}) end
:telemetry.attach_many("test", Sender.telemetry_events(), handle_event, nil)

Manual Event Sending

Construct your own Opencensus.Honeycomb.Event.t/0, and send it with Opencensus.Honeycomb.Sender.send_batch/1:

alias Opencensus.Honeycomb.{Event, Sender}
[%Event{time: Event.now(), data: %{name: "hello"}}] |> Sender.send_batch()