OpentelemetryStatifier.Config (OpentelemetryStatifier v0.1.0)

Copy Markdown View Source

The validated result of OpentelemetryStatifier.setup/1's options, carried through :telemetry.attach/4 as the handler Config argument (the family's unanimous pattern for setup-time options - see the plan's Key Discoveries).

Two keys are recognised:

  • :record_datamodel_values - defaults to false. Parsed and carried here; not yet read anywhere (ots-j82 reads it once the datamodel effect events are mapped).
  • :table - the ETS table name the handler reads and writes against. Defaults to OpentelemetryStatifier.SpanTable, the module name standing in for the table name until Phase 2 gives that name a real table.

An unknown key is rejected rather than ignored: a typo'd record_datamodel_value silently doing nothing is exactly the failure the project's cardinality policy cannot afford.

Summary

Functions

Validates a keyword list of setup options into a t().

Types

t()

@type t() :: %OpentelemetryStatifier.Config{
  record_datamodel_values: boolean(),
  table: atom()
}

Functions

new(opts)

@spec new(keyword()) :: {:ok, t()} | {:error, term()}

Validates a keyword list of setup options into a t().

Returns {:error, {:invalid_options, :not_a_keyword_list}} when opts is not even a keyword list, {:error, {:unknown_options, keys}} when it contains keys outside :record_datamodel_values/:table, and {:error, {:invalid_option, key, value}} when a recognised key holds a value of the wrong shape.