From 82a9a2a65302de8f744d87ccfe14fa9b91abbec6 Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Mon, 27 Jul 2026 10:06:12 +0200 Subject: [PATCH 1/3] feat(core): Export instrumentStateGraph and deprecate instrumentLangGraph The JavaScript SDK renamed `instrumentLangGraph` to `instrumentStateGraph` in v10.68.0 and marked the old name as deprecated. Re-export the new name and keep the old one for backwards compatibility until the next major. Co-Authored-By: Claude Opus 5 (1M context) --- CHANGELOG.md | 12 ++++++++++++ packages/core/etc/sentry-react-native.api.md | 3 +++ packages/core/src/js/index.ts | 5 ++++- packages/core/test/aiExports.test.ts | 5 +++++ 4 files changed, 24 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 72df6f4db5..708ca2f53b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,18 @@ ## Unreleased +### Features + +- Export `instrumentStateGraph` for manual LangGraph instrumentation ([#PR_NUMBER](https://github.com/getsentry/sentry-react-native/pull/PR_NUMBER)) + + `instrumentLangGraph` was renamed to `instrumentStateGraph` in the JavaScript SDK and is now deprecated. It remains exported for backwards compatibility and will be removed in the next major version. + + ```js + import * as Sentry from '@sentry/react-native'; + + const graph = Sentry.instrumentStateGraph(new StateGraph(...)); + ``` + ### 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); + }); }); From b5f12811a1250b72b9eb3578a0d5549c53494f64 Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Mon, 27 Jul 2026 10:07:37 +0200 Subject: [PATCH 2/3] chore: add PR link to changelog entry Co-Authored-By: Claude Opus 5 (1M context) --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 708ca2f53b..5d8f7591b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ ### Features -- Export `instrumentStateGraph` for manual LangGraph instrumentation ([#PR_NUMBER](https://github.com/getsentry/sentry-react-native/pull/PR_NUMBER)) +- Export `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 remains exported for backwards compatibility and will be removed in the next major version. From d6b4f7b6b2b555409f6fb186080a4fb2e97dd04c Mon Sep 17 00:00:00 2001 From: Antonis Lilis Date: Mon, 27 Jul 2026 10:14:56 +0200 Subject: [PATCH 3/3] chore: move changelog entry to Changes section Matches the precedent set by the featureFlagsIntegration and logger re-export entries, which are Changes rather than Features. Co-Authored-By: Claude Opus 5 (1M context) --- CHANGELOG.md | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d8f7591b0..474be6c28d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,17 +8,10 @@ ## Unreleased -### Features - -- Export `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 remains exported for backwards compatibility and will be removed in the next major version. - - ```js - import * as Sentry from '@sentry/react-native'; +### Changes - const graph = Sentry.instrumentStateGraph(new StateGraph(...)); - ``` +- 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