Breaking Changes
- Complete SDK re-architecture — monolithic
Telemetryclass replaced with modular, composable API - New bootstrap API —
initLatitude()replacesnew Telemetry()as primary entry point capture()no longer creates spans — now only attaches context to spans created by auto-instrumentation- Context propagation changed — uses OpenTelemetry's native Context API instead of baggage
- Removed manual instrumentation (
telemetry.tracerstill available via advanced setup) - Removed
Telemetryclass andTelemetryOptionsinterface - Removed
Instrumentorsenum — now use string literals viaregisterLatitudeInstrumentations()
Added
initLatitude()— one-call bootstrap for complete OTel + LLM instrumentation setupLatitudeSpanProcessor— composable span processor for shared-provider setupsregisterLatitudeInstrumentations()— register LLM auto-instrumentations (OpenAI, Anthropic, etc.)- Smart span filtering — only LLM-relevant spans exported by default (gen_ai., llm., openinference., ai. attributes)
disableSmartFilteroption — export all spans instead of just LLM spansshouldExportSpancallback — custom span filteringblockedInstrumentationScopesoption — filter out unwanted instrumentation scopescapture()now supports nested calls with proper context merging (tags dedupe, metadata shallow merge, last-write-wins for userId/sessionId)- Integration examples for Datadog and Sentry
Changed
- SDK is now OpenTelemetry-first — designed for composability with existing OTel setups
capture()uses OTel'scontext.with()for reliable async context propagation- Span processors use standard OTel APIs (no deprecated methods)
- Package structure: SDK split into
sdk/init.ts,sdk/context.ts,sdk/processor.ts,sdk/span-filter.ts,sdk/types.ts