Jido.Signal.Ext.Trace (Jido Signal v2.2.0)

View Source

Trace extension for Jido Signal correlation and debugging.

Provides fields for tracking signal causation and distributed tracing:

  • trace_id - constant for entire call chain (32 hex chars, 128-bit)
  • span_id - unique for this signal (16 hex chars, 64-bit)
  • parent_span_id - span that triggered this signal
  • causation_id - signal ID that caused this signal
  • tracestate - optional W3C tracestate for vendor-specific data

W3C Trace Context Compatibility

This extension supports the W3C Trace Context standard for distributed tracing. When serialized, it includes a traceparent header in the standard format:

00-{trace_id}-{span_id}-01

This enables interoperability with OpenTelemetry and other W3C-compatible systems.

CloudEvents Distributed Tracing Extension

Serializes to CloudEvents distributed tracing extension attributes:

  • traceparent - W3C traceparent header
  • tracestate - W3C tracestate (optional)
  • trace_id, span_id - Individual fields for convenience
  • parent_span_id, causation_id - Jido-specific fields

See Also

Summary

Functions

Validates data according to this extension's schema.

Functions

validate_data(data)

@spec validate_data(term()) :: {:ok, term()} | {:error, String.t()}

Validates data according to this extension's schema.

Parameters

  • data - The data to validate

Returns

{:ok, validated_data} if valid, {:error, reason} otherwise

Examples

iex> MyExt.validate_data(%{user_id: "123"})
{:ok, %{user_id: "123"}}

iex> MyExt.validate_data(%{})
{:error, "required :user_id option not found"}