class Integration implements IntegrationInterface

Constants

private CONTEXT_TRANSACTION_KEY

Methods

void
setupOnce()

Register the event processor that adds the Swoole version and transaction name.

static void
handles(Exceptions $exceptions)

Register the exception handler with the Hypervel exception configuration.

static void
addBreadcrumb(Breadcrumb $breadcrumb)

Add a breadcrumb if the integration is enabled.

static void
configureScope(callable $callback)

Configure the scope if the integration is enabled.

static string|null
getTransaction()

Get the current transaction name from coroutine-local storage.

static void
setTransaction(string|null $transaction)

Set the current transaction name in coroutine-local storage.

static void
setConversationId(string|null $conversationId)

Set the conversation ID when an integration does not provide it automatically, such as the ClassificationIntegration.

static Result
drainEvents(int|null $timeout = null)

Flush buffered events and wait for the captured delivery generation.

static array
extractNameAndSourceForRoute(Route $route)

Extract the readable name and transaction source for a route.

static string
sentryMeta()

Retrieve the meta tags with tracing information to link this request to front-end requests.

static string
sentryTracingMeta()

Retrieve the sentry-trace meta tag with tracing information to link this request to front-end requests.

static string
sentryBaggageMeta()

Retrieve the baggage meta tag with information to link this request to front-end requests.

static EventId|null
captureUnhandledException(Throwable $throwable)

Capture an unhandled exception and report it to Sentry.

static callable
missingAttributeViolationReporter(callable|null $callback = null, bool $suppressDuplicateReports = true, bool $reportAfterResponse = true)

Return a callback for Model::handleMissingAttributeViolationUsing to report missing attribute violations to Sentry.

static callable
lazyLoadingViolationReporter(callable|null $callback = null, bool $suppressDuplicateReports = true, bool $reportAfterResponse = true)

Return a callback for Model::handleLazyLoadingViolationUsing to report lazy loading violations to Sentry.

static callable
discardedAttributeViolationReporter(callable|null $callback = null, bool $suppressDuplicateReports = true, bool $reportAfterResponse = true)

Return a callback for Model::handleDiscardedAttributeViolationUsing to report discarded attribute violations to Sentry.

Details

at line 39
void setupOnce()

Register the event processor that adds the Swoole version and transaction name.

Return Value

void

at line 68
static void handles(Exceptions $exceptions)

Register the exception handler with the Hypervel exception configuration.

When the configuration wraps the application's worker-shared handler, the reportable callback persists for the worker lifetime.

Parameters

Exceptions $exceptions

Return Value

void

at line 78
static void addBreadcrumb(Breadcrumb $breadcrumb)

Add a breadcrumb if the integration is enabled.

Parameters

Breadcrumb $breadcrumb

Return Value

void

at line 92
static void configureScope(callable $callback)

Configure the scope if the integration is enabled.

Parameters

callable $callback

Return Value

void

at line 106
static string|null getTransaction()

Get the current transaction name from coroutine-local storage.

Return Value

string|null

at line 114
static void setTransaction(string|null $transaction)

Set the current transaction name in coroutine-local storage.

Parameters

string|null $transaction

Return Value

void

at line 126
static void setConversationId(string|null $conversationId)

Set the conversation ID when an integration does not provide it automatically, such as the ClassificationIntegration.

This can also be useful if AI calls are proxied so the conversation ID has to persist across multiple requests.

Parameters

string|null $conversationId

Return Value

void

at line 136
static Result drainEvents(int|null $timeout = null)

internal  
 

Flush buffered events and wait for the captured delivery generation.

Parameters

int|null $timeout

Return Value

Result

at line 158
static array extractNameAndSourceForRoute(Route $route)

internal  this helper is used in various places to extract meaningful info from a Route object
 

Extract the readable name and transaction source for a route.

Parameters

Route $route

Return Value

array

at line 172
static string sentryMeta()

Retrieve the meta tags with tracing information to link this request to front-end requests.

This propagates the Dynamic Sampling Context.

Return Value

string

at line 180
static string sentryTracingMeta()

Retrieve the sentry-trace meta tag with tracing information to link this request to front-end requests.

Return Value

string

at line 191
static string sentryBaggageMeta()

Retrieve the baggage meta tag with information to link this request to front-end requests.

This propagates the Dynamic Sampling Context.

Return Value

string

at line 207
static EventId|null captureUnhandledException(Throwable $throwable)

Capture an unhandled exception and report it to Sentry.

Parameters

Throwable $throwable

Return Value

EventId|null

at line 228
static callable missingAttributeViolationReporter(callable|null $callback = null, bool $suppressDuplicateReports = true, bool $reportAfterResponse = true)

Return a callback for Model::handleMissingAttributeViolationUsing to report missing attribute violations to Sentry.

Parameters

callable|null $callback

optional callback to be called after the violation is reported to Sentry

bool $suppressDuplicateReports
bool $reportAfterResponse

Return Value

callable

at line 238
static callable lazyLoadingViolationReporter(callable|null $callback = null, bool $suppressDuplicateReports = true, bool $reportAfterResponse = true)

Return a callback for Model::handleLazyLoadingViolationUsing to report lazy loading violations to Sentry.

Parameters

callable|null $callback

optional callback to be called after the violation is reported to Sentry

bool $suppressDuplicateReports
bool $reportAfterResponse

Return Value

callable

at line 248
static callable discardedAttributeViolationReporter(callable|null $callback = null, bool $suppressDuplicateReports = true, bool $reportAfterResponse = true)

Return a callback for Model::handleDiscardedAttributeViolationUsing to report discarded attribute violations to Sentry.

Parameters

callable|null $callback

optional callback to be called after the violation is reported to Sentry

bool $suppressDuplicateReports
bool $reportAfterResponse

Return Value

callable