Jido.Observe.Tracer behaviour (Jido v2.0.0-rc.1)
View SourceBehaviour for tracing backends.
Implement this behaviour to integrate OpenTelemetry or other tracing systems.
The default implementation is Jido.Observe.NoopTracer which does nothing.
Example Implementation
A future jido_otel package could implement this:
defmodule JidoOtel.Tracer do
@behaviour Jido.Observe.Tracer
def span_start(event_prefix, metadata) do
# Create OpenTelemetry span and return context
end
def span_stop(tracer_ctx, measurements) do
# End the span with success status
end
def span_exception(tracer_ctx, kind, reason, stacktrace) do
# End the span with error status
end
end
Summary
Callbacks
Called when a span completes with an exception.
Called when a span starts.
Called when a span completes successfully.
Types
Callbacks
@callback span_exception( tracer_ctx(), kind :: atom(), reason :: term(), stacktrace :: list() ) :: :ok
Called when a span completes with an exception.
@callback span_start(event_prefix(), metadata()) :: tracer_ctx()
Called when a span starts.
Returns context to be passed to span_stop/2 or span_exception/4.
@callback span_stop(tracer_ctx(), measurements()) :: :ok
Called when a span completes successfully.