The uniform measurement/metadata-to-attribute mapping the design note
(statifier-ex docs/opentelemetry.md, "Attribute mapping") fixes, applied
to span events rather than re-decided per event name.
Every attribute lands under the statifier. namespace. Measurements are
numbers by contract and pass through as numeric attributes of the same
name. Metadata is mapped by shape:
:effectis never serialized - the raw struct is for in-VM consumers; a wire format is where "the struct rides verbatim" stops being cheap.:location(a%Statifier.Parser.Location{}) flattens tostatifier.source.line/statifier.source.column- the one place the bridge flattens a struct, because OTel attributes are scalar.:configuration(already state-id strings by the ADR-0040 contract) becomes a sorted string-array attribute, bounded by the chart's state count.:new_value,:prior_value, and:datamodelare the unbounded datamodel values: excluded unless the host opted in at setup withrecord_datamodel_values: true, and rendered withinspect/1when it did - they are arbitrary terms, andinspect/1is the only rendering that needs no per-type policy.- everything else is identity metadata: strings and integers pass
through, atoms become strings, tuples (an
owner, chart vocabulary of bounded shape) render withinspect/1,nilis omitted rather than encoded, and any other shape is dropped - a malformed value costs one attribute, never the event.
Summary
Functions
Maps one event's measurements and metadata into span-event
attributes under the rules above, honoring config's
record_datamodel_values opt-in.
Functions
@spec span_event_attributes(map(), map(), OpentelemetryStatifier.Config.t()) :: map()
Maps one event's measurements and metadata into span-event
attributes under the rules above, honoring config's
record_datamodel_values opt-in.