-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Expand file tree
/
Copy pathinstrumentation.ts
More file actions
28 lines (26 loc) · 878 Bytes
/
instrumentation.ts
File metadata and controls
28 lines (26 loc) · 878 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/**
* 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')
}
}