()
| 289 | } |
| 290 | |
| 291 | async function doInitializeTelemetry(): Promise<void> { |
| 292 | if (telemetryInitialized) { |
| 293 | // Already initialized, nothing to do |
| 294 | return |
| 295 | } |
| 296 | |
| 297 | // Set flag before init to prevent double initialization |
| 298 | telemetryInitialized = true |
| 299 | try { |
| 300 | await setMeterState() |
| 301 | } catch (error) { |
| 302 | // Reset flag on failure so subsequent calls can retry |
| 303 | telemetryInitialized = false |
| 304 | throw error |
| 305 | } |
| 306 | } |
| 307 | |
| 308 | async function setMeterState(): Promise<void> { |
| 309 | // Lazy-load instrumentation to defer ~400KB of OpenTelemetry + protobuf |
no test coverage detected