Spandex v1.6.0 Spandex.Span View Source

A container for all span data and metadata.

Link to this section Summary

Link to this section Types

Link to this type t() View Source
t() :: %Spandex.Span{completion_time: timestamp, env: String.t, error: Spandex.Span.Error.t | nil, http: Spandex.Span.Http.t | nil, id: term, name: String.t, parent_id: term, resource: String.t, service: atom, sql_query: Spandex.Span.SqlQuery.t | nil, start: timestamp, tags: Keyword.t | nil, trace_id: term, type: atom}
Link to this type timestamp() View Source
timestamp() :: term

Link to this section Functions

Link to this function child_of(parent, name, id, start, opts) View Source

Create a new span.


Opts

  • id(:any) Required
  • trace_id(:any) Required
  • name(:string) Required
  • env(:string) Required
  • service(:atom) Required
  • start(:any) Required
  • http([:keyword, {:struct, Spandex.Span.Http}])
  • error([:keyword, {:struct, Spandex.Span.Error}])
  • completion_time(:any)
  • parent_id(:any)
  • resource([:atom, :string])
  • services(:keyword) - Default: []
  • sql_query([:keyword, {:struct, Spandex.Span.SqlQuery}])
  • type(:atom)
  • tags(:keyword) - Default: []

Also accepts extra opts that are not named here.


Link to this function update(span, opts, schema \\ Map.put(%{__struct__: Optimal.Schema, annotations: [], custom: [], defaults: [tags: [], services: []], describe: [], extra_keys?: true, opts: [:id, :trace_id, :name, :http, :error, :completion_time, :env, :parent_id, :resource, :service, :services, :sql_query, :start, :type, :tags], required: [:id, :trace_id, :name, :env, :service, :start], types: [id: :any, trace_id: :any, name: :string, http: [:keyword, {:struct, Spandex.Span.Http}], error: [:keyword, {:struct, Spandex.Span.Error}], completion_time: :any, env: :string, parent_id: :any, resource: [:atom, :string], service: :atom, services: :keyword, sql_query: [:keyword, {:struct, Spandex.Span.SqlQuery}], start: :any, type: :atom, tags: :keyword]}, :required, [])) View Source

Update an existing span.


Opts

  • id(:any)
  • trace_id(:any)
  • name(:string)
  • http([:keyword, {:struct, Spandex.Span.Http}])
  • error([:keyword, {:struct, Spandex.Span.Error}])
  • completion_time(:any)
  • env(:string)
  • parent_id(:any)
  • resource([:atom, :string])
  • service(:atom)
  • services(:keyword) - Default: []
  • sql_query([:keyword, {:struct, Spandex.Span.SqlQuery}])
  • start(:any)
  • type(:atom)
  • tags(:keyword) - Default: []

Also accepts extra opts that are not named here.