View Source otel_ctx (opentelemetry_api v1.3.0)
Ctx is responsible for propagating values within a process that are associated with a particular Trace or set of Baggage. OpenTelemetry.Tracer
and OpenTelemetry.Baggage
handle updating the Context.
Ctx
argument and variants that implicitly use the current context, which is the context stored in the process dictionary.
Link to this section Summary
Functions
Attaches the given context to the current process.
Removes all key-value pairs from the given context.
Ctx
is undefined
.Removes the value under the given key from the given context.
Sets a value in the given context under the given key.
Attaches a context and runs a function, detaching the context at the end.
Link to this section Types
-type key() :: term().
-type t() :: map() | undefined.
-opaque token()
-type value() :: term().
Link to this section Functions
Attaches the given context to the current process.
Essentially, this setsCtx
as the current context .
-spec clear() -> ok.
Removes all key-value pairs from the given context.
Returns an empty context.-spec get_current() -> map().
-spec get_value(term()) -> eqwalizer:dynamic().
-spec get_value(term(), term()) -> eqwalizer:dynamic().
-spec get_value(t(), term(), term()) -> eqwalizer:dynamic().
Ctx
is undefined
.
-spec new() -> t().
-spec remove(term()) -> ok.
Removes the value under the given key from the given context.
Returns the updated context.-spec set_value(term(), term()) -> ok.
Sets a value in the given context under the given key.
Returns the updated context.Attaches a context and runs a function, detaching the context at the end.
Returns the detached context.