Refactor monitoring instrumentation code across modules
The monitoring instrumentation methodology has been simplified for both Baselime and Sentry providers by aligning their registration functions and error handling processes. Specifically, function names have been standardized to 'registerInstrumentation' and handling for the absence of the INSTRUMENTATION_SERVICE_NAME environment variable is now conducted within these functions. In addition, the MONITORING_INSTRUMENTATION_PROVIDER variable has been renamed to MONITORING_PROVIDER.
This commit is contained in:
@@ -23,19 +23,19 @@ export async function registerMonitoringInstrumentation() {
|
||||
|
||||
switch (MONITORING_PROVIDER) {
|
||||
case InstrumentationProvider.Baselime: {
|
||||
const { registerBaselimeInstrumentation } = await import(
|
||||
const { registerInstrumentation } = await import(
|
||||
'@kit/baselime/instrumentation'
|
||||
);
|
||||
|
||||
return registerBaselimeInstrumentation();
|
||||
return registerInstrumentation();
|
||||
}
|
||||
|
||||
case InstrumentationProvider.Sentry: {
|
||||
const { registerSentryInstrumentation } = await import(
|
||||
const { registerInstrumentation } = await import(
|
||||
'@kit/sentry/instrumentation'
|
||||
);
|
||||
|
||||
return registerSentryInstrumentation();
|
||||
return registerInstrumentation();
|
||||
}
|
||||
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user