opencensus_honeycomb v0.3.0 Opencensus.Honeycomb.Config

Configuration.

Out of the box, we supply suitable defaults 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",
  samplerate_key: "samplerate",
  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

The module and keyword arguments for your Opencensus.Honeycomb.Decorator implementation.

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

decorator()

decorator() :: {module(), keyword()}

The module and keyword arguments for your Opencensus.Honeycomb.Decorator implementation.

Link to this type

t()

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

Our configuration struct.

  • api_endpoint: the API endpoint
  • batch_size: the batch size
  • dataset: the dataset
  • decorator: the decorator module and arguments (nil disables decoration)
  • service_name: the service name
  • samplerate_key: the sample rate key (nil disables setting the sample rate)
  • write_key: the write key (nil disables sending spans)

Default values:

  • api_endpoint: "https://api.honeycomb.io"
  • batch_size: 100
  • dataset: "opencensus"
  • decorator: nil
  • samplerate_key: nil
  • service_name: "-"
  • write_key: nil

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, noteffective/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, noteffective/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.