Atom-name → canonical {module, config} normalization for SDK
configuration values.
Three input forms are accepted everywhere a module is selected:
- shortcut atom (
:otlp,:console,:batch,:always_on, ...) — spec-blessed enum names mapped through built-in tables to project modules. The shortcut set is closed; only spec values defined inconfiguration/sdk-environment-variables.mdL122-L131, L243-L265, and L143-L152 are accepted. - module atom (e.g.
Otel.OTLP.Trace.SpanExporter.HTTP) — direct module reference, normalized to{Module, %{}}. - {module, config} tuple — passed through unchanged. Always the
canonical form a provider expects at its
start_link/1boundary.
Same normalizers serve both code paths — Mix Config (config :otel, trace: [exporter: :otlp | Module | {Module, %{}}]) and OTEL_* env
vars (which can only ever produce a shortcut atom because the spec
enums are strings).
Public API
| Function | Spec section |
|---|---|
trace_exporter/1 | sdk-environment-variables.md L243-L254 |
metrics_exporter/1 | L244, L258-L265 |
logs_exporter/1 | L245 |
trace_processor/1 | trace/sdk.md §SpanProcessor (no env var) |
logs_processor/1 | logs/sdk.md §LogRecordProcessor (no env var) |
sampler/1 | L143-L152 |
propagator/1 | L122-L131 (OTEL_PROPAGATORS) |
Out of scope (future PRs)
:zipkin,:prometheus— exporters not implemented in this repo.:logging— spec L254 deprecated, "SHOULD NOT be supported by new implementations".:jaeger_remote/:parentbased_jaeger_remotesamplers — depend on a remote sampling protocol not yet implemented.:xraysampler — third-party.
Summary
Functions
Normalizes a logs exporter spec to {module, config} or :none.
Normalizes a log record processor selector to a module reference.
Normalizes a metrics exporter spec to {module, config} or :none.
Normalizes a single-propagator selector to a module reference.
Normalizes a sampler selector to {module, opts} (the shape the
built-in Otel.SDK.Trace.Sampler.new/1 consumes).
Normalizes a trace exporter spec to {module, config} or :none.
Normalizes a span processor selector to a module reference. The caller wraps it with the exporter + processor knobs at composition time.
Functions
Normalizes a logs exporter spec to {module, config} or :none.
Normalizes a log record processor selector to a module reference.
Normalizes a metrics exporter spec to {module, config} or :none.
Normalizes a single-propagator selector to a module reference.
Spec L122-L131 enumerates eight known values; this SDK
implements three: :tracecontext, :baggage, and :none.
Other spec-named propagators (:b3, :b3multi, :jaeger,
:xray, :ottrace) raise ArgumentError — their behaviours
are not bundled in this package.
Custom propagator modules pass through unchanged so users can
plug their own implementations of
Otel.API.Propagator.TextMap.
Normalizes a sampler selector to {module, opts} (the shape the
built-in Otel.SDK.Trace.Sampler.new/1 consumes).
Accepts spec enum atoms (:always_on, :parentbased_always_on, ...),
the parameterized {:traceidratio, ratio} /
{:parentbased_traceidratio, ratio} tuples, a custom module, or a
{module, opts} tuple passed through unchanged.
Normalizes a trace exporter spec to {module, config} or :none.
Normalizes a span processor selector to a module reference. The caller wraps it with the exporter + processor knobs at composition time.