@oribos/semconv
v0.9.0
Published
Oribos semconv leaf package — the GenAI semantic-convention mapping pure parts (name/kind/attributes of an ExportedSpan, message payload conversion, attribute value-domain rules) shared by the OTLP exporter and the OTel bridge.
Maintainers
Readme
@oribos/semconv
GenAI semantic-convention mapping pure parts for Oribos —
the leaf package shared by the OTLP exporter (@oribos/otlp) and the OTel bridge
(@oribos/otel-bridge).
One job: turn an Oribos ExportedSpan
into its GenAI semconv shape — the rebuilt span name, the OTel SpanKind, and the assembled
attributes:
mapSpan— the seven-type mapping contract (agent-run / agent-step / tool-call / workflow-run / workflow-step / memory-recall / memory-save, open types pass through),{operation} {name}naming,gen_ai.operation.name/gen_ai.request.*/gen_ai.usage.*attributes, and theoribos.*vocabulary.- Message payload conversion —
ModelMessage[]prompts split intogen_ai.system_instructionsandgen_ai.input.messages, model output becomesgen_ai.output.messages. - Attribute value-domain rules — OTel attributes carry primitives only; everything else
best-effort JSON, with
droppedAttributesCountaccounting.
Stateless pure functions, no transport, no SDK: the leaf decides nothing about where spans go.
The only external dependency is @opentelemetry/api (for SpanKind / attribute types); the
core is a peer.
See docs/architecture/observability.md「映射契约(七类 + 兜底)」for the frozen contract this
package implements (ADR-0002 leaf package edge, ADR-0009 reversibility asymmetry).
