API Reference otel v#0.4.1

Copy Markdown View Source

Modules

OTel Baggage (spec baggage/api.md, Status: Stable).

W3C Baggage percent-encoding codec (W3C Baggage spec §value L64-L69, §property L82-L100).

Macro module injecting shared OTel type aliases into consumer modules.

OTel Context (spec context/README.md, Status: Stable).

Identity of the code that produced telemetry (spec common/instrumentation-scope.md, Status: Stable).

Bridges Erlang's :logger to the OpenTelemetry Logs API (OTel logs/api.md + logs/supplementary-guidelines.md §How to Create a Log4J Log Appender).

Logs API facade — emit entry point and shared types (logs/api.md §LoggerProvider L62-L97 + logs/data-model.md §Severity Fields L234-L363).

LogRecord data model (logs/data-model.md §"Log and Event Record Definition" L155-L451; Status: Stable).

Logs export pipeline — timer-driven take from LogRecordStorage + OTLP encode + HTTP POST. Single GenServer collapsing what was previously a separate LogRecordProcessor (queue + timer + drain) plus a passive HTTP-only Exporter.

Configurable limits for Otel.Logs.LogRecord attribute collections (logs/sdk.md §LogRecord Limits L321-348).

ETS-backed FIFO queue for log records awaiting export.

Log record emission entry points for the SDK.

Metrics API facade.

Aggregation behaviour and default instrument-to-aggregation mapping (metrics/sdk.md §Aggregation L612-L860).

Explicit bucket histogram aggregation.

Last value aggregation. Keeps the most recent measurement.

Sum aggregation. Collects the arithmetic sum of measurements.

Synchronous Counter instrument facade (OTel metrics/api.md §Counter, Status: Stable, L497-L598).

An Exemplar is a recorded measurement that links metric data to trace context. Exemplars are sampled from measurements by ExemplarReservoirs and attached to metric data points during collection.

Exemplar filter — trace_based only.

A reservoir aligned with explicit histogram bucket boundaries.

A reservoir that uses uniformly-weighted random sampling.

Synchronous Gauge instrument facade (OTel metrics/api.md §Gauge, Status: Stable, L828-L916).

Synchronous Histogram instrument facade (OTel metrics/api.md §Histogram, Status: Stable, L735-L827).

Instrument handle (OTel metrics/api.md §Instrument, Status: Stable, L178-L278).

ETS owner for the named ETS table — one row per registered Instrument keyed by downcased_name (spec metrics/api.md §Instrument identity L190-L191). InstrumentationScope is hardcoded SDK-wide (project memory project_minikube_hardcode_decisions § Follow-on #457), so it is omitted from the key.

SDK implementation of the Otel.Metrics.Meter behaviour (metrics/sdk.md §Meter L870-L943).

Metric data model — one metric record produced by Otel.Metrics.MetricExporter.collect/1 and consumed by Otel.OTLP.Encoder.encode_metrics/1 (metrics/data-model.md §Metric L300-L391; Status: Stable).

Metrics export pipeline — timer-driven snapshot of the per-table XxxStorage GenServers + OTLP encode + HTTP POST. Single GenServer collapsing what was previously a separate Otel.Metrics.MetricReader.PeriodicExporting GenServer (timer + collect) plus a passive HTTP-only MetricExporter module.

ETS owner for the named ETS table — aggregated datapoints keyed by {stream_name, attrs} (spec metrics/data-model.md §Metric). InstrumentationScope is hardcoded SDK-wide so it is omitted from the key.

Synchronous UpDownCounter instrument facade (OTel metrics/api.md §UpDownCounter, Status: Stable, L1032-L1157).

OTLP exporter for OpenTelemetry.

TextMap propagator facade (OTel context/api-propagators.md §TextMap Propagator L114-L203; §Composite Propagator L259-L305).

W3C Baggage propagator (W3C HTTP_HEADER_FORMAT.md §Header Content L19-L113; OTel context/api-propagators.md §TextMap Inject/Extract L155-L203).

W3C Trace Context Level 2 propagator (W3C 20-http_request_header_format.md §Traceparent Header L51-L244; OTel context/api-propagators.md §TextMap L114-L203).

SDK Resource (resource/sdk.md §"SDK").

Telemetry.Metrics reporter that bridges BEAM :telemetry events into the OTel Metrics pipeline. Mirror of Otel.LoggerHandler for the metrics pillar.

@span annotation that auto-wraps a function in :telemetry.span/3. Companion to Otel.TelemetryTracer — the tracer turns telemetry spans into OTel spans, the decorator removes the boilerplate of wrapping function bodies manually.

Bridges BEAM :telemetry.span/3 events into the OTel Trace pipeline. Trace pillar's analog of Otel.LoggerHandler (Logs) and Otel.TelemetryReporter (Metrics).

Trace API facade — Context Interaction and Span Creation entry points (OTel trace/api.md §Context Interaction L159-L183, §Span Creation L378-L414).

A timestamped event recorded on a Span (spec trace/api.md §Add Events, Status: Stable, L520-L558).

Hardcoded random ID generator — the only generator this SDK ships.

A link from the current Span to another SpanContext (spec trace/api.md §Link, Status: Stable, L803-L834).

Hard-coded ParentBased(root=AlwaysOn) sampler — the spec default per trace/sdk.md L421 and the only sampler this SDK ships.

SDK implementation of the Otel.Trace.Span behaviour (trace/sdk.md §Span L692-L944) — data + lifecycle operations.

Immutable context of a Span (spec trace/api.md §SpanContext, Status: Stable, L221-L278).

Trace export pipeline — timer-driven take from SpanStorage + OTLP encode + HTTP POST. Single GenServer absorbing what was previously split between SpanProcessor (queue + timer + drain) and a HTTP-only Exporter.

Opaque 64-bit Span identifier (W3C parent-id / OTel trace/api.md §SpanContext SpanId, L234-L235).

SpanKind — clarifies the relationship between Spans (spec trace/api.md §SpanKind, Status: Stable).

Configurable limits for Span data.

ETS-backed storage for spans across their full lifecycle — both active (mutable via set_attribute / add_event) and completed (waiting for export after end_span) spans live in a single table.

A Span's Status (spec trace/api.md §Set Status, Status: Stable).

Opaque 128-bit Trace identifier (W3C trace-id / OTel trace/api.md §SpanContext TraceId, L231-L232).

W3C Trace Context tracestate field (spec §3.3).

Span creation entry points for the SDK.