OpenTelemetry PHP

ImplicitContextKeyedInterface

Represents a value that can be stored within {@see ContextInterface}.

Allows storing themselves without exposing a ContextKeyInterface.

Tags
see
https://github.com/open-telemetry/opentelemetry-specification/blob/v1.6.1/specification/trace/api.md#context-interaction
see
https://github.com/open-telemetry/opentelemetry-specification/blob/v1.6.1/specification/baggage/api.md#context-interaction

Table of Contents

Methods

activate()  : ScopeInterface
Adds `$this` to the {@see Context::getCurrent() current context} and makes the new {@see Context} the current context.
storeInContext()  : ContextInterface
Returns a new {@see ContextInterface} created by setting `$this` into the provided [@see ContextInterface}.

Methods

activate()

Adds `$this` to the {@see Context::getCurrent() current context} and makes the new {@see Context} the current context.

public activate() : ScopeInterface

ScopeInterface::detach() MUST be called to properly restore the previous context.

This method is equivalent to Context::getCurrent().with($value).activate();.

Tags
todo:

Update this to suggest using the new helper method way to doing something in a specific context/span.

Return values
ScopeInterface

        
On this page

Search results