Breaking Changes
instrumentationsis now an object mapping integration name → LLM SDK module. Replaces the magic-string array form. Example:instrumentations: { openai: OpenAI, anthropic: AnthropicSDK }. The consumer passes the LLM SDK module they already imported, so the patch lands on the same prototype their app code calls.- The string-array form (
instrumentations: ["openai"]) is removed with no fallback. Passing a string array — or anything other than a plain object — throws at register time. Migration:instrumentations: { openai: OpenAI }. See the README's "Migrating frominstrumentations: ["openai"]" section. modulesoption onregisterLatitudeInstrumentationsis removed. Pass the module directly under its integration key oninstrumentations.- Why:
tryRequireinside the telemetry package's ESM-compiled__requireshim loaded the CJS build of dual-bundled LLM SDKs (openai@6,@anthropic-ai/sdk@0.96, …), while the consumer app loaded the ESM build. Patching the CJS class had no effect on instances the app code actually called, so no traces appeared while the SDK reported a healthy bootstrap. Forcing the consumer to pass the module makes that bug impossible to express.
Added
- New
InstrumentationNameandInstrumentationsInputtypes exported from@latitude-data/telemetry.
Removed
tryRequirefallback (the CJS/ESM auto-resolver behind the string-array path).- Legacy
LEGACY_INSTRUMENTATION_MAPlookup table.