- Updated application version from 2.21.8 to 2.21.9 in package.json. - Upgraded dependencies including prettier to version 3.7.4, @supabase/supabase-js to version 2.86.0, and @tanstack/react-query to version 5.90.11. - Adjusted various package.json files to reflect updated versions for lucide-react, react-hook-form, and nodemailer. - Enhanced pnpm-lock.yaml and pnpm-workspace.yaml for consistency in package versions. - Refactored import statements in several components for improved readability.
43 lines
1.1 KiB
TypeScript
43 lines
1.1 KiB
TypeScript
/**
|
|
* This file is used to register monitoring instrumentation
|
|
* for your Next.js application.
|
|
*/
|
|
import { type Instrumentation } from 'next';
|
|
|
|
export async function register() {
|
|
const { registerMonitoringInstrumentation } =
|
|
await import('@kit/monitoring/instrumentation');
|
|
|
|
// Register monitoring instrumentation
|
|
// based on the MONITORING_PROVIDER environment variable.
|
|
await registerMonitoringInstrumentation();
|
|
}
|
|
|
|
/**
|
|
* @name onRequestError
|
|
* @description This function is called when an error occurs during the request lifecycle.
|
|
* It is used to capture the error and send it to the monitoring service.
|
|
*/
|
|
export const onRequestError: Instrumentation.onRequestError = async (
|
|
err,
|
|
request,
|
|
context,
|
|
) => {
|
|
const { getServerMonitoringService } = await import('@kit/monitoring/server');
|
|
|
|
const service = await getServerMonitoringService();
|
|
|
|
await service.ready();
|
|
|
|
await service.captureException(
|
|
err as Error,
|
|
{},
|
|
{
|
|
path: request.path,
|
|
headers: request.headers,
|
|
method: request.method,
|
|
routePath: context.routePath,
|
|
},
|
|
);
|
|
};
|