Tapper v0.6.0 Tapper.Id View Source
The ID used with the API; tracks nested spans.
Clients should consider this ID opaque!
Use destructure/1
to obtain trace parameters. NB special value :ignore
produces no-ops in API functions.
Link to this section Summary
Functions
Destructure the id into external hex notation, for trace propagation purposes
Create id from trace context
Pop the last parent span id from the parent stack, returning updated Tapper Id
Push the current span id onto the parent stack, and set new span id, returning updated Tapper Id
is the trace with this id being sampled?
Generate a TraceId for testing; sample is true
Link to this section Functions
destructure(id) View Source
Destructure the id into external hex notation, for trace propagation purposes.
Example
id = Tapper.start()
{trace_id_hex, span_id_hex, parent_span_id_hex, sampled_flag, debug_flag} =
Tapper.Id.destructure(id)
init(trace_id, span_id, parent_span_id, sample, debug)
View Source
init(
trace_id :: Tapper.TraceId.t(),
span_id :: Tapper.SpanId.t(),
parent_span_id :: Tapper.SpanId.t() | :root,
sample :: boolean(),
debug :: boolean()
) :: t()
init( trace_id :: Tapper.TraceId.t(), span_id :: Tapper.SpanId.t(), parent_span_id :: Tapper.SpanId.t() | :root, sample :: boolean(), debug :: boolean() ) :: t()
Create id from trace context
pop(id)
View Source
pop(Tapper.Id.t()) :: Tapper.Id.t()
pop(Tapper.Id.t()) :: Tapper.Id.t()
Pop the last parent span id from the parent stack, returning updated Tapper Id
push(id, span_id)
View Source
push(Tapper.Id.t(), Tapper.SpanId.t()) :: Tapper.Id.t()
push(Tapper.Id.t(), Tapper.SpanId.t()) :: Tapper.Id.t()
Push the current span id onto the parent stack, and set new span id, returning updated Tapper Id
sampled?(id)
View Source
sampled?(id :: t()) :: boolean()
sampled?(id :: t()) :: boolean()
is the trace with this id being sampled?
test_id(parent_span_id \\ :root) View Source
Generate a TraceId for testing; sample is true