Repository navigation
v0.11.1
Hardening pass after PR review.
Critical fixes
getTracerwrap recursion guard — tracers are cached by provider, so a secondgetTracer(name, version)call would re-bind the already-wrappedstartSpanand recurse infinitely. Now guarded with a__monoscopeWrappedflag.createMeterProviderfailure no longer escapes the constructor — wrapped in try/catch, nulls outmeterProvideron failure, matching the SDK's never-throw-into-host-code contract.- Pageview span now rotates after 30 min (
PAGEVIEW_MAX_MS). Without this, long-running SPAs without route changes left the parent span open andBatchSpanProcessornever shipped it.
Important fixes
- Skip
MeterProviderentirely whencaptureWebVitals: false(was wasting a 30s timer + empty exports). WebVitalNameliteral type ("LCP" | "INP" | "CLS" | "FCP" | "TTFB") prevents phantom histograms from typo'd callers.shutdown()usesPromise.allSettledso a metric pipeline failure doesn't abort trace shutdown.metricsExporterEndpointdebug-warns whenexporterEndpointis custom but doesn't match/v1/traces— silent metric POSTs to a trace endpoint were a confusing failure mode.
Polish
- Trimmed verbose comments flagged by review.
- New tests:
closestInteractive,recordWebVitalhistogram caching/naming/units, constructor failure path,captureWebVitalsflag gate.