Spandex v1.4.0 Spandex.Tracer behaviour View Source

A module that can be used to build your own tracer.

Example:

defmodule MyApp.Tracer do
  use Spandex.Tracer, otp_app: :my_app
end

Link to this section Summary

Functions

A schema for the opts that a tracer accepts

Link to this section Types

Link to this type attributes() View Source
attributes() :: map
Link to this type span_name() View Source
span_name() :: String.t
Link to this type tagged_tuple() View Source
tagged_tuple() :: {:ok, term} | {:error, term}

Link to this section Functions

A schema for the opts that a tracer accepts.


Opts

  • adapter(:atom) Required: The third party adapter to use.
  • service(:atom) Required: The default service name to use for spans declared without a service.
  • disabled?(:boolean): Allows for wholesale disabling a tracer. - Default: false
  • env(:string): A name used to identify the environment name, e.g prod or development - Default: “unknown”
  • services({:keyword, :atom}): A mapping of service name to the default span types. For instance datadog knows about :db, :cache and :web - Default: []
  • sender(:atom): Will be deprecated soon, but this is a module that defines a send_spans/1 function. - Default: Spandex.Datadog.ApiServer

All tracer functions that take opts use this schema.

Link to this section Callbacks

Link to this callback configure(opts) View Source
configure(opts) :: :ok
Link to this callback continue_trace(span_name, trace_id, span_id, opts) View Source
continue_trace(span_name, trace_id :: term, span_id :: term, opts) :: tagged_tuple
Link to this callback continue_trace_from_span(span_name, span, opts) View Source
continue_trace_from_span(span_name, span :: term, opts) :: tagged_tuple
Link to this callback current_span(opts) View Source
current_span(opts) :: tagged_tuple
Link to this callback current_span_id(opts) View Source
current_span_id(opts) :: tagged_tuple
Link to this callback current_trace_id(opts) View Source
current_trace_id(opts) :: tagged_tuple
Link to this callback distributed_context(arg0, opts) View Source
distributed_context(Plug.Conn.t, opts) :: tagged_tuple
Link to this callback finish_span(opts) View Source
finish_span(opts) :: tagged_tuple
Link to this callback finish_trace(opts) View Source
finish_trace(opts) :: tagged_tuple
Link to this macro callback span(span_name, attributes, opts, list) View Source
span(term, span_name, attributes, opts, [{:do, Macro.t}]) :: Macro.t
Link to this callback span_error(error, opts) View Source
span_error(error :: Exception.t, opts) :: tagged_tuple
Link to this callback start_span(span_name, attributes, opts) View Source
Link to this callback start_trace(span_name, attributes, opts) View Source
Link to this macro callback trace(span_name, attributes, opts, list) View Source
trace(term, span_name, attributes, opts, [{:do, Macro.t}]) :: Macro.t
Link to this callback update_span(attributes, opts) View Source
update_span(attributes, opts) :: tagged_tuple
Link to this callback update_top_span(attributes, opts) View Source
update_top_span(attributes, opts) :: tagged_tuple