diff --git a/CHANGELOG.md b/CHANGELOG.md index 72df6f4db5..474be6c28d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,11 @@ ## Unreleased +### Changes + +- Expose `instrumentStateGraph` for manual LangGraph instrumentation ([#6520](https://github.com/getsentry/sentry-react-native/pull/6520)) + - `instrumentLangGraph` was renamed to `instrumentStateGraph` in the JavaScript SDK and is now deprecated. It stays exported for backwards compatibility and will be removed in the next major version. + ### Internal - Migrate from `@sentry/babel-plugin-component-annotate` to `@sentry/bundler-plugins/babel-plugin` ([#6501](https://github.com/getsentry/sentry-react-native/pull/6501)) diff --git a/packages/core/etc/sentry-react-native.api.md b/packages/core/etc/sentry-react-native.api.md index 2c83a46489..fab4e9b602 100644 --- a/packages/core/etc/sentry-react-native.api.md +++ b/packages/core/etc/sentry-react-native.api.md @@ -59,6 +59,7 @@ import { InstrumentedMethod } from '@sentry/core'; import { instrumentGoogleGenAIClient } from '@sentry/core'; import { instrumentLangGraph } from '@sentry/core'; import { instrumentOpenAiClient } from '@sentry/core'; +import { instrumentStateGraph } from '@sentry/core'; import { instrumentStateGraphCompile } from '@sentry/core'; import { Integration } from '@sentry/core'; import { LangChainIntegration } from '@sentry/core'; @@ -465,6 +466,8 @@ export { instrumentLangGraph } export { instrumentOpenAiClient } +export { instrumentStateGraph } + export { instrumentStateGraphCompile } export { LangChainIntegration } diff --git a/packages/core/src/js/index.ts b/packages/core/src/js/index.ts index b27837538c..62c8585f71 100644 --- a/packages/core/src/js/index.ts +++ b/packages/core/src/js/index.ts @@ -54,11 +54,14 @@ export { instrumentAnthropicAiClient, instrumentGoogleGenAIClient, createLangChainCallbackHandler, - instrumentLangGraph, + instrumentStateGraph, instrumentStateGraphCompile, addConsoleInstrumentationFilter, } from '@sentry/core'; +/** @deprecated Use `instrumentStateGraph` instead. `instrumentLangGraph` will be removed in a future major version. */ +export { instrumentLangGraph } from '@sentry/core'; + export type { OpenAiClient, OpenAiOptions, diff --git a/packages/core/test/aiExports.test.ts b/packages/core/test/aiExports.test.ts index 559ccb6ea8..73d9f36d77 100644 --- a/packages/core/test/aiExports.test.ts +++ b/packages/core/test/aiExports.test.ts @@ -6,9 +6,14 @@ describe('AI SDK manual instrumentation re-exports', () => { 'instrumentAnthropicAiClient', 'instrumentGoogleGenAIClient', 'createLangChainCallbackHandler', + 'instrumentStateGraph', 'instrumentLangGraph', 'instrumentStateGraphCompile', ])('re-exports %s from @sentry/core', name => { expect(typeof (Sentry as Record)[name]).toBe('function'); }); + + test('deprecated instrumentLangGraph is an alias of instrumentStateGraph', () => { + expect(Sentry.instrumentLangGraph).toBe(Sentry.instrumentStateGraph); + }); });