Files
myeasycms-v2/apps/web/instrumentation.ts
giancarlo 591c4557c0 Update environment variable references
Environment variables in multiple files have been updated to correctly reference public variables. Moreover, the conditional check for MONITORING_INSTRUMENTATION_ENABLED has been corrected to explicitly check for the string 'true'. This change ensures that our application correctly accesses public environmental variables and behaves as expected under the conditions defined by these variables.
2024-05-01 18:59:18 +07:00

20 lines
553 B
TypeScript

/**
* This file is used to register monitoring instrumentation
* for your Next.js application.
*/
export async function register() {
// only run in nodejs runtime
if (
process.env.NEXT_RUNTIME === 'nodejs' &&
process.env.MONITORING_INSTRUMENTATION_ENABLED === 'true'
) {
const { registerMonitoringInstrumentation } = await import(
'@kit/monitoring/instrumentation'
);
// Register monitoring instrumentation based on the MONITORING_PROVIDER environment variable.
return registerMonitoringInstrumentation();
}
}