InsightHub - viames/pair GitHub Wiki
Pair framework: InsightHub
Pair\Services\InsightHub sends errors, exceptions, warnings, and info messages to Insight Hub (Bugsnag-based integration).
When to use
Use it when you want external error monitoring and incident visibility across environments.
Main methods
error(string $name, string $message): voidwarning(string $name, string $message): voidinfo(string $name, string $message): voidexception(Throwable $exception, string $severity = 'error'): voidhandle(string $message, int $phpError): voidgetSeverity(int $errorType): string
Implementation examples
Business event as info/warning
\Pair\Services\InsightHub::info('OrderExported', 'Order #2241 exported');
\Pair\Services\InsightHub::warning('SlowGateway', 'Gateway response > 4s');
Exception reporting
try {
(new BillingService())->charge($order);
} catch (\Throwable $e) {
\Pair\Services\InsightHub::exception($e, 'error');
throw $e;
}
Common pitfalls
- Missing
INSIGHT_HUB_API_KEYdisables reporting. - Exception grouping quality depends on consistent error naming.