Integration
class Integration implements IntegrationInterface
Constants
| private CONTEXT_TRANSACTION_KEY |
|
Methods
Register the event processor that adds the Swoole version and transaction name.
Register the exception handler with the Hypervel exception configuration.
Add a breadcrumb if the integration is enabled.
Configure the scope if the integration is enabled.
Get the current transaction name from coroutine-local storage.
Set the current transaction name in coroutine-local storage.
Set the conversation ID when an integration does not provide it automatically, such as the ClassificationIntegration.
Flush buffered events and wait for the captured delivery generation.
Extract the readable name and transaction source for a route.
Retrieve the meta tags with tracing information to link this request to front-end requests.
Retrieve the sentry-trace meta tag with tracing information to link this request to front-end requests.
Retrieve the baggage meta tag with information to link this request to front-end requests.
Capture an unhandled exception and report it to Sentry.
Return a callback for Model::handleMissingAttributeViolationUsing to report missing attribute violations to Sentry.
Return a callback for Model::handleLazyLoadingViolationUsing to report lazy loading violations to Sentry.
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.
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.
at line 78
static void
addBreadcrumb(Breadcrumb $breadcrumb)
Add a breadcrumb if the integration is enabled.
at line 92
static void
configureScope(callable $callback)
Configure the scope if the integration is enabled.
at line 106
static string|null
getTransaction()
Get the current transaction name from coroutine-local storage.
at line 114
static void
setTransaction(string|null $transaction)
Set the current transaction name in coroutine-local storage.
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.
at line 136
static Result
drainEvents(int|null $timeout = null)
| internal |
Flush buffered events and wait for the captured delivery generation.
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.
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.
at line 180
static string
sentryTracingMeta()
Retrieve the sentry-trace meta tag with tracing information to link this request to front-end requests.
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.
at line 207
static EventId|null
captureUnhandledException(Throwable $throwable)
Capture an unhandled exception and report it to Sentry.
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.
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.
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.