class QueueFeature extends Feature

Traits

Track pushed scopes and spans using coroutine-local storage.

Constants

private QUEUE_SPAN_OP_QUEUE_PUBLISH

private QUEUE_PAYLOAD_BAGGAGE_DATA

private QUEUE_PAYLOAD_TRACE_PARENT_DATA

private QUEUE_PAYLOAD_PUBLISH_TIME

Methods

__construct(Container $container)

Create a new feature instance.

from  Feature
bool
isApplicable()

Indicate if the feature is applicable to the current environment.

void
register()

Register the feature in the environment.

from  Feature
void
onBoot()

Set up the feature in the environment.

void
onBootInactive()

Set up the feature in the environment in an inactive state (when no DSN was set).

from  Feature
void
boot()

Initialize the feature.

from  Feature
void
bootInactive()

Initialize the feature in an inactive state (when no DSN was set).

from  Feature
array
getUserConfig()

Retrieve the user configuration.

from  Feature
bool
shouldSendDefaultPii()

Determine if default PII should be sent.

from  Feature
bool
isTracingFeatureEnabled(string $feature, bool $default = true)

Indicate if the given feature is enabled for tracing.

from  Feature
bool
isBreadcrumbFeatureEnabled(string $feature, bool $default = true)

Indicate if the given feature is enabled for breadcrumbs.

from  Feature
void
pushSpan(Span $span)

Push a span onto the coroutine-local stack and set it as current on the hub.

void
pushScope()

No description

Span|null
maybePopSpan()

Pop a span from the coroutine-local stack and restore the parent span.

void
maybePopScope()

Pop a scope from the hub if one was pushed in this coroutine.

Span|null
maybeFinishSpan(SpanStatus|null $status = null)

Finish the current span if one exists on the coroutine-local stack.

void
handleJobQueueingEvent(JobQueueing $event)

No description

void
handleJobQueuedEvent(JobQueued $event)

No description

void
void
void
handleJobFailedEvent(JobFailed $event)

Handle a permanently failed job.

void

Details

in Feature at line 33
__construct(Container $container)

Create a new feature instance.

Parameters

Container $container

at line 46
bool isApplicable()

Indicate if the feature is applicable to the current environment.

Return Value

bool

in Feature at line 46
void register()

Register the feature in the environment.

Return Value

void

at line 57
void onBoot()

Set up the feature in the environment.

Return Value

void

in Feature at line 62
void onBootInactive()

Set up the feature in the environment in an inactive state (when no DSN was set).

Return Value

void

in Feature at line 69
void boot()

Initialize the feature.

Return Value

void

in Feature at line 83
void bootInactive()

Initialize the feature in an inactive state (when no DSN was set).

Return Value

void

in Feature at line 97
protected array getUserConfig()

Retrieve the user configuration.

Return Value

array

in Feature at line 105
protected bool shouldSendDefaultPii()

Determine if default PII should be sent.

Return Value

bool

in Feature at line 119
protected bool isTracingFeatureEnabled(string $feature, bool $default = true)

Indicate if the given feature is enabled for tracing.

Parameters

string $feature
bool $default

Return Value

bool

in Feature at line 131
protected bool isBreadcrumbFeatureEnabled(string $feature, bool $default = true)

Indicate if the given feature is enabled for breadcrumbs.

Parameters

string $feature
bool $default

Return Value

bool

protected void pushSpan(Span $span)

Push a span onto the coroutine-local stack and set it as current on the hub.

Parameters

Span $span

Return Value

void

at line 258
protected void pushScope()

No description

Return Value

void

protected Span|null maybePopSpan()

Pop a span from the coroutine-local stack and restore the parent span.

Return Value

Span|null

protected void maybePopScope()

Pop a scope from the hub if one was pushed in this coroutine.

Return Value

void

protected Span|null maybeFinishSpan(SpanStatus|null $status = null)

Finish the current span if one exists on the coroutine-local stack.

Parameters

SpanStatus|null $status

Return Value

Span|null

at line 98
void handleJobQueueingEvent(JobQueueing $event)

No description

Parameters

JobQueueing $event

Return Value

void

at line 119
void handleJobQueuedEvent(JobQueued $event)

No description

Parameters

JobQueued $event

Return Value

void

at line 124
void handleJobProcessedQueueEvent(JobProcessed $event)

No description

Parameters

JobProcessed $event

Return Value

void

at line 131
void handleJobProcessingQueueEvent(JobProcessing $event)

No description

Parameters

JobProcessing $event

Return Value

void

at line 226
void handleJobFailedEvent(JobFailed $event)

Handle a permanently failed job.

Finishes the span with an error status but does not pop the scope — breadcrumbs need to remain available for exception reporting. The next JobProcessing event will clean up via its maybePopScope() call before pushing a new scope.

Parameters

JobFailed $event

Return Value

void

at line 231
void handleWorkerStoppingQueueEvent(WorkerStopping $event)

No description

Parameters

WorkerStopping $event

Return Value

void

at line 236
void handleJobExceptionOccurredQueueEvent(JobExceptionOccurred $event)

No description

Parameters

JobExceptionOccurred $event

Return Value

void