View Source Ash.Tracer behaviour (ash v2.11.8)

A behaviour for implementing tracing for an Ash application.

Link to this section Summary

Link to this section Types

@type metadata() :: %{
  api: nil | module(),
  resource: nil | module(),
  actor: term(),
  tenant: nil | String.t(),
  action: atom(),
  authorize?: boolean()
}
@type span_type() ::
  :action
  | :changeset
  | :query
  | :flow
  | :request_step
  | :change
  | :validation
  | :preparation
  | :custom_flow_step
  | :custom
  | {:custom, atom()}
@type t() :: module()

Link to this section Callbacks

@callback get_span_context() :: term()
@callback set_error(Exception.t()) :: :ok
Link to this callback

set_metadata(span_type, metadata)

View Source
@callback set_metadata(span_type(), metadata()) :: :ok

Set metadata for the current span.

This may be called multiple times per span, and should ideally merge with previous metadata.

@callback set_span_context(term()) :: :ok
Link to this callback

start_span(span_type, name)

View Source
@callback start_span(span_type(), name :: String.t()) :: :ok
@callback stop_span() :: :ok

Link to this section Functions

Link to this function

set_metadata(tracer, type, metadata)

View Source
Link to this macro

span(type, name, tracer, block_opts \\ [])

View Source (macro)
Link to this macro

telemetry_span(name, metadata, opts)

View Source (macro)