Sentry + Turbopack fixes (#28)

* Updated packages

Updated all packages to the latest versions

* Refactor Sentry monitoring configuration and services

The Sentry monitoring configuration and services have been refactored to simplify the setup process. In addition, unnecessary files or exports have been removed from the Sentry package. These changes should make the process of initializing and using the Sentry monitoring services in both the client and server more straightforward and efficient.

* Refactor server-side Sentry instrumentation code

The conditional logic responsible for checking the runtime environment and the enabled status of the monitoring instrumentation has been adjusted. This refactoring simplifies the code, making it more readable, by clearly separating the conditions and nesting the environment-specific operations. A typo in the environment variable name "ENABLE_MONITORING_INSTRMENTATION" was also corrected to "ENABLE_MONITORING_INSTRUMENTATION".

* Rename environment variable for monitoring instrumentation

The environment variable controlling monitoring instrumentation has been renamed from 'MONITORING_INSTRUMENTATION_ENABLED' to 'ENABLE_MONITORING_INSTRUMENTATION'. It affects both the README and .env.production files within the monitoring/api and apps/web directories respectively.
This commit is contained in:
Giancarlo Buomprisco
2024-05-28 15:17:56 +07:00
committed by GitHub
parent 1e047463c8
commit c495335fd5
26 changed files with 581 additions and 301 deletions

View File

@@ -2,18 +2,12 @@
* 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'
);
const { registerMonitoringInstrumentation } = await import(
'@kit/monitoring/instrumentation'
);
// Register monitoring instrumentation based on the MONITORING_PROVIDER environment variable.
return registerMonitoringInstrumentation();
}
// Register monitoring instrumentation
// based on the MONITORING_PROVIDER environment variable.
await registerMonitoringInstrumentation();
}