#
View Source Ash.Tracer behaviour (ash v2.14.2)

A behaviour for implementing tracing for an Ash application.

# Link to this section Summary

## Types

metadata()
span_type()
t()

## Callbacks

get_span_context()
set_error(t)
set_metadata(span_type, metadata)

Set metadata for the current span.

set_span_context(term)
start_span(span_type, name)
stop_span()

## Functions

set_metadata(tracer, type, metadata)
span(type, name, tracer, block_opts \\ [])
telemetry_span(name, metadata, opts)

# Link to this section Types

Link to this type

# metadata()

View Source

    @type metadata() :: %{
      api: nil | module(),
      resource: nil | module(),
      actor: term(),
      tenant: nil | String.t(),
      action: atom(),
      authorize?: boolean()
    }

Link to this type

# span_type()

View Source

    @type span_type() ::
      :action
      | :changeset
      | :query
      | :flow
      | :request_step
      | :change
      | :validation
      | :preparation
      | :custom_flow_step
      | :custom
      | {:custom, atom()}

Link to this type

# t()

View Source

    @type t() :: module()

# Link to this section Callbacks

Link to this callback

# get_span_context()

View Source

    @callback get_span_context() :: term()

Link to this callback

# set_error(t)

View Source

    @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.

Link to this callback

# set_span_context(term)

View Source

    @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

Link to this callback

# stop_span()

View Source

    @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)