struct OpenTelemetry::Context
- OpenTelemetry::Context
- Struct
- Value
- Object
Defined in:
opentelemetry-api/context.cropentelemetry-api/context/key.cr
Constructors
Class Method Summary
- .attach(context)
- .clear
- .create_key(name)
- .create_key
- .current
-
.detach(token)
Restores the previous Context associated with the current Fiber.
- .stack
-
.with_current(ctx, &)
Executes a block with ctx as the current context.
-
.with_value(key, value, &)
Execute a block in a new context with key set to value.
-
.with_values(values, &)
@param [String] key The lookup key @param [Hash] values Will be merged with values of the current context and returned in a new context @param [Callable] Block to execute in a new context @yield [context, values] Yields the newly created context and values to the block
Instance Method Summary
Constructor Detail
Class Method Detail
Restores the previous Context associated with the current Fiber. The supplied token is used to check if the call to detach is balanced with a corresponding attach call. A warning is logged if the calls are unbalanced.
Executes a block with ctx as the current context. It restores the previous context upon exiting.
Execute a block in a new context with key set to value. Restores the previous context after the block executes.
@param [String] key The lookup key @param [Hash] values Will be merged with values of the current context and returned in a new context @param [Callable] Block to execute in a new context @yield [context, values] Yields the newly created context and values to the block