opencensus_honeycomb v0.1.1 Opencensus.Honeycomb.Config

Configuration.

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

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")

If you're using Mix, you probably won't need to use effective/0, get/0, and put/1.

Link to this section Summary

Types

t()

Our configuration struct.

Functions

Get the effective configuration, using default values where necessary.

Get the application configuration without using default values.

Inserts into the application configuration.

Put to the application configuration.

Link to this section Types

Link to this type

t()
t() :: %Opencensus.Honeycomb.Config{
  api_endpoint: String.t() | nil,
  batch_size: integer() | nil,
  dataset: String.t() | nil,
  service_name: String.t() | nil,
  write_key: String.t() | nil
}

Our configuration struct.

  • api_endpoint: the API endpoint (default:"https://api.honeycomb.io")
  • batch_size: the write key (default:100)
  • dataset: the dataset (default:"opencensus")
  • service_name: the service name (default:"-"
  • write_key: the write key (default:nil)

A write_key of nil disables sending to Honeycomb.

Link to this section Functions

Link to this function

effective()
effective() :: t()

Get the effective configuration, using default values where necessary.

Link to this function

get()
get() :: t()

Get the application configuration without using default values.

Link to this function

into(fields)
into(keyword()) :: t()

Inserts into the application configuration.

Returns the result of get/0, not effective/0.

Does not replace fields that are not specified. To "delete" a field from the config so the default takes effect in effective/0, set it to nil. Consider put/1, instead.

Crashes with a KeyError if any keys are invalid; see Kernel.struct!/2.

Link to this function

put(config)
put(map() | t()) :: t()

Put to the application configuration.

Returns the result of get/0, not effective/0.

When called with a map, replaces known fields that are not specified with nil. Does not delete or modify unknown keys present in the application configuration.

Crashes with a KeyError if any keys are invalid; see Kernel.struct!/2.