Spandex v2.0.0 Spandex.Span View Source
A container for all span data and metadata.
Link to this section Summary
Functions
Create a new span
Link to this section Types
Link to this type
t()
View Source
t() :: %Spandex.Span{ completion_time: timestamp(), env: String.t(), error: Keyword.t() | nil, http: Keyword.t() | nil, id: term(), name: String.t(), parent_id: term(), private: Keyword.t(), resource: String.t(), service: atom(), sql_query: Keyword.t() | nil, start: timestamp(), tags: Keyword.t() | nil, trace_id: term(), type: atom() }
Link to this section Functions
Create a new span.
Opts
id
(:any
) Requiredtrace_id
(:any
) Requiredname
(:string
) Requiredenv
(:string
) Requiredservice
(:atom
) Requiredstart
(:any
) Requiredhttp
(:keyword
)error
(:keyword
)completion_time
(:any
)parent_id
(:any
)private
(:keyword
) - Default: []resource
([:atom, :string]
)services
(:keyword
) - Default: []sql_query
(:keyword
)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: [], private: []], describe: [], extra_keys?: true, opts: [:id, :trace_id, :name, :http, :error, :completion_time, :env, :parent_id, :private, :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, error: :keyword, completion_time: :any, env: :string, parent_id: :any, private: :keyword, resource: [:atom, :string], service: :atom, services: :keyword, sql_query: :keyword, start: :any, type: :atom, tags: :keyword]}, :required, []))
View Source
Update an existing span.
Opts
id
(:any
)trace_id
(:any
)name
(:string
)http
(:keyword
)error
(:keyword
)completion_time
(:any
)env
(:string
)parent_id
(:any
)private
(:keyword
) - Default: []resource
([:atom, :string]
)service
(:atom
)services
(:keyword
) - Default: []sql_query
(:keyword
)start
(:any
)type
(:atom
)tags
(:keyword
) - Default: []
Also accepts extra opts that are not named here.
Special Meta
[
http: [
url: "my_website.com?foo=bar",
status_code: "400",
method: "GET",
query_string: "foo=bar",
user_agent: "Mozilla/5.0...",
request_id: "special_id"
],
error: [
exception: ArgumentError.exception("foo"),
stacktrace: System.stacktrace(),
error?: true # Used for specifying that a span is an error when there is no exception or stacktrace.
],
sql_query: [
rows: 100,
db: "my_database",
query: "SELECT * FROM users;"
],
# Private has the same structure as the outer meta structure, but private metadata does not
# transfer from parent span to child span.
private: [
...
]
]