ConsoleSchedulingIntegration
class ConsoleSchedulingIntegration extends Feature
Traits
Track pushed scopes and spans using coroutine-local storage.
Constants
| CHECK_INS_CONTEXT_KEY |
The context key for the check-ins in progress in the current coroutine. |
Methods
Indicate if the feature is applicable to the current environment.
Register the sentryMonitor scheduling macro.
Set up the feature in the environment.
Set up the feature in the environment in an inactive state (when no DSN was set).
Indicate if the given feature is enabled for tracing.
Indicate if the given feature is enabled for breadcrumbs.
Push a span onto the coroutine-local stack and set it as current on the hub.
Push a scope onto the hub and track the count in coroutine-local storage.
Track an operation-local span without making it current on the Hub.
Pop a span from the coroutine-local stack and restore the parent span.
Pop a scope from the hub if one was pushed in this coroutine.
Finish the current span if one exists on the coroutine-local stack.
Finish an operation-local span by key if one exists.
Call the callback with the current span if it is sampled.
Get the status of an operation that cancellation stopped.
Finish tracing the scheduled task with its published outcome.
Mark tracing and the unfinished check-ins of the scheduled task as failed.
Finish tracing the scheduled task that cancellation stopped before its outcome was published.
Details
at line 124
bool
isApplicable()
Indicate if the feature is applicable to the current environment.
at line 44
void
register()
Register the sentryMonitor scheduling macro.
at line 132
void
onBoot()
Set up the feature in the environment.
at line 153
void
onBootInactive()
Set up the feature in the environment in an inactive state (when no DSN was set).
in
Feature at line 71
void
boot()
Initialize the feature.
in
Feature at line 81
void
bootInactive()
Initialize the feature in an inactive state (when no DSN was set).
in
Feature at line 91
protected array
getUserConfig()
Retrieve the user configuration.
in
Feature at line 99
protected bool
shouldSendDefaultPii()
Determine if default PII should be sent.
in
Feature at line 113
protected bool
shouldCollectGenAiInputs()
Determine whether AI inputs may be collected.
in
Feature at line 121
protected bool
shouldCollectGenAiOutputs()
Determine whether AI outputs may be collected.
in
Feature at line 146
protected bool
isTracingFeatureEnabled(string $feature, bool $default = true)
Indicate if the given feature is enabled for tracing.
in
Feature at line 159
protected bool
isBreadcrumbFeatureEnabled(string $feature, bool $default = true)
Indicate if the given feature is enabled for breadcrumbs.
in
Feature at line 182
protected bool
canRecordSpans()
Determine if the active SDK client can record spans.
in
Feature at line 196
protected bool
canRecordBreadcrumbs()
Determine if the active SDK client can record breadcrumbs.
in
TracksPushedScopesAndSpans at line 26
protected void
pushSpan(Span $span)
Push a span onto the coroutine-local stack and set it as current on the hub.
in
TracksPushedScopesAndSpans at line 45
protected Scope
pushScope()
Push a scope onto the hub and track the count in coroutine-local storage.
in
TracksPushedScopesAndSpans at line 59
protected void
trackLocalSpan(string $key, Span $span)
Track an operation-local span without making it current on the Hub.
in
TracksPushedScopesAndSpans at line 70
protected Span|null
maybePopSpan()
Pop a span from the coroutine-local stack and restore the parent span.
in
TracksPushedScopesAndSpans at line 93
protected void
maybePopScope()
Pop a scope from the hub if one was pushed in this coroutine.
in
TracksPushedScopesAndSpans at line 109
protected Span|null
maybeFinishSpan(SpanStatus|null $status = null)
Finish the current span if one exists on the coroutine-local stack.
in
TracksPushedScopesAndSpans at line 129
protected Span|null
maybeFinishLocalSpan(string $key, SpanStatus|null $status = null)
Finish an operation-local span by key if one exists.
in
WorksWithSpans at line 18
protected Span|null
getParentSpanIfSampled()
Get the current span if it is sampled.
in
WorksWithSpans at line 35
protected void
withParentSpanIfSampled(callable $callback)
Call the callback with the current span if it is sampled.
in
WorksWithSpans at line 53
protected SpanStatus|null
cancellationStatus(Throwable $cancellation, Throwable|null $exception = null)
Get the status of an operation that cancellation stopped.
A direct cancellation with no earlier failure leaves the status unset: it is control flow, and the SDK has no canceled status. A known failure, or a cleanup failure carrying the cancellation, is an error.
at line 164
void
handleScheduledTaskStarting(ScheduledTaskStarting $event)
Start tracing the scheduled task.
at line 184
void
handleScheduledTaskFinished(ScheduledTaskFinished $event)
Finish tracing the scheduled task with its published outcome.
at line 192
void
handleScheduledTaskFailed()
Mark tracing and the unfinished check-ins of the scheduled task as failed.
at line 204
void
handleScheduledTaskCanceled(ScheduledTaskCanceled $event)
Finish tracing the scheduled task that cancellation stopped before its outcome was published.
A direct cancellation leaves an unfinished check-in without a terminal status: the SDK has no canceled status, and the cancellation is not a task failure.