Composes a validated declarative-config in-memory model into the
per-pillar provider config maps that
Otel.SDK.{Trace.TracerProvider, Metrics.MeterProvider, Logs.LoggerProvider}
consume at start_link/1.
Implements spec configuration/sdk.md §Create:
"Interpret configuration model and return SDK components."
Pipeline used by Otel.Configuration:
File.read!(path)
|> Otel.Configuration.Substitution.substitute!()
|> Otel.Configuration.Parser.parse_string!()
|> Otel.Configuration.Schema.validate!()
|> Otel.Configuration.Composer.compose!()Output shape mirrors Otel.SDK.Config.{trace,metrics,logs}/0 so
the wiring layer (Otel.SDK.Application) can swap config sources
transparently — env-var path or declarative-file path produces
the same map shape.
Stable-only policy
Per .claude/rules/workflow.md and the project's
"Stable only" stance, the composer:
- Warns + skips any
*/development-suffixed property at the sub-property level (e.g.resource.detection/development,meter_configuration/development). - Raises when the YAML asks for a feature not implemented
in our SDK (e.g.
pullMetricReader for Prometheus,otlp_grpcexporter,zipkinexporter). These are spec-stable but missing from this repo's SDK surface.
Component coverage
| Pillar | Sampler | Processor / Reader | Exporter |
|---|---|---|---|
| Trace | always_on, always_off, trace_id_ratio_based, parent_based | batch, simple | otlp_http, console |
| Metrics | n/a | periodic | otlp_http, console |
| Logs | n/a | batch, simple | otlp_http, console |
Resource
Built from the YAML's resource.attributes (list of
{name, value, type}) and resource.attributes_list (W3C
Baggage-format string), merged onto the project's
telemetry.sdk.* baseline. Does not read
OTEL_RESOURCE_ATTRIBUTES / OTEL_SERVICE_NAME from the
process env — when OTEL_CONFIG_FILE is set, spec L332-L337
forbids reading other OTEL_* env vars except via explicit YAML
substitution (attributes_list: ${OTEL_RESOURCE_ATTRIBUTES}).
Public API
| Function | Role |
|---|---|
compose!/1 | SDK (Create) — model → %{trace, metrics, logs} config maps |
References
- Spec Create:
opentelemetry-specification/specification/configuration/sdk.md§Create - Schema docs:
references/opentelemetry-configuration/schema-docs.md
Summary
Functions
Composes a validated configuration model into per-pillar SDK provider configs plus the global propagator value.