OpenTelemetry tracing and structured logging helpers for Orkestra.
Provides span creation, attribute extraction, and trace context propagation for the CQRS pipeline.
Summary
Functions
Clears Orkestra-specific Logger metadata.
Creates span attributes from a command envelope.
Creates span attributes for an Orkestra.ES.Repository operation.
Creates span attributes for an ES storage operation (single-doc or bulk).
Creates span attributes from an event envelope.
Extracts OTel trace context from AMQP headers into the current process.
Injects the current OTel trace context into AMQP-compatible headers.
Returns a list of {key, :longstr, value} tuples.
Creates span attributes from Orkestra metadata.
Converts Metadata to a Logger-compatible keyword list.
Creates span attributes for a projector event-processing span.
Sets Logger metadata from Orkestra metadata for the current process.
Also injects trace_id and span_id from the current OTel context
so that logs can be correlated with traces in SigNoz.
Call this at the start of handler execution.
Wraps a function in a named span with Orkestra attributes.
Automatically sets span status to error on {:error, _} returns.
Functions
Clears Orkestra-specific Logger metadata.
Creates span attributes from a command envelope.
Creates span attributes for an Orkestra.ES.Repository operation.
Used by the generated repository functions (get/2, save/2, count/2, …)
to describe the targeted index and resolved culture. Never include cluster
credentials or adapter options here (convention T-08-02).
@spec es_span_attrs(String.t(), String.t(), atom(), non_neg_integer() | nil) :: map()
Creates span attributes for an ES storage operation (single-doc or bulk).
Creates span attributes from an event envelope.
Extracts OTel trace context from AMQP headers into the current process.
Injects the current OTel trace context into AMQP-compatible headers.
Returns a list of {key, :longstr, value} tuples.
Creates span attributes from Orkestra metadata.
Converts Metadata to a Logger-compatible keyword list.
@spec projector_span_attrs(String.t(), map(), non_neg_integer()) :: map()
Creates span attributes for a projector event-processing span.
Sets Logger metadata from Orkestra metadata for the current process.
Also injects trace_id and span_id from the current OTel context
so that logs can be correlated with traces in SigNoz.
Call this at the start of handler execution.
Wraps a function in a named span with Orkestra attributes.
Automatically sets span status to error on {:error, _} returns.