Files
sim/apps/sim/instrumentation.ts
Waleed 9efc08a832 fix(telemetry): updated telemetry, added nested sanitization, added granular trace spans for logs and updated UI (#1627)
* feat(logs): updated telemetry, added nested sanitization, added granular trace spans for logs and updated UI

* refactor trace spans into separate components

* remove any's from tool defs

* updated UI and overlayed spans

* cleanup

* ack PR comments

* stricter type safety

* clean
2025-10-14 16:41:12 -07:00

29 lines
878 B
TypeScript

/**
* OpenTelemetry Instrumentation Entry Point
*
* This is the main entry point for OpenTelemetry instrumentation.
* It delegates to runtime-specific instrumentation modules.
*/
export async function register() {
// Load Node.js-specific instrumentation
if (process.env.NEXT_RUNTIME === 'nodejs') {
const nodeInstrumentation = await import('./instrumentation-node')
if (nodeInstrumentation.register) {
await nodeInstrumentation.register()
}
}
// Load Edge Runtime-specific instrumentation
if (process.env.NEXT_RUNTIME === 'edge') {
const edgeInstrumentation = await import('./instrumentation-edge')
if (edgeInstrumentation.register) {
await edgeInstrumentation.register()
}
}
// Load client instrumentation if we're on the client
if (typeof window !== 'undefined') {
await import('./instrumentation-client')
}
}