Skip to content

Commit a9df5ce

Browse files
antonisclaude
andauthored
feat(core): Export instrumentStateGraph and deprecate instrumentLangGraph (#6520)
* 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) <noreply@anthropic.com> * chore: add PR link to changelog entry Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * 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) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent e1501d0 commit a9df5ce

4 files changed

Lines changed: 17 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
99
## Unreleased
1010

11+
### Changes
12+
13+
- Expose `instrumentStateGraph` for manual LangGraph instrumentation ([#6520](https://github.com/getsentry/sentry-react-native/pull/6520))
14+
- `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.
15+
1116
### Internal
1217

1318
- Migrate from `@sentry/babel-plugin-component-annotate` to `@sentry/bundler-plugins/babel-plugin` ([#6501](https://github.com/getsentry/sentry-react-native/pull/6501))

packages/core/etc/sentry-react-native.api.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ import { InstrumentedMethod } from '@sentry/core';
5959
import { instrumentGoogleGenAIClient } from '@sentry/core';
6060
import { instrumentLangGraph } from '@sentry/core';
6161
import { instrumentOpenAiClient } from '@sentry/core';
62+
import { instrumentStateGraph } from '@sentry/core';
6263
import { instrumentStateGraphCompile } from '@sentry/core';
6364
import { Integration } from '@sentry/core';
6465
import { LangChainIntegration } from '@sentry/core';
@@ -465,6 +466,8 @@ export { instrumentLangGraph }
465466

466467
export { instrumentOpenAiClient }
467468

469+
export { instrumentStateGraph }
470+
468471
export { instrumentStateGraphCompile }
469472

470473
export { LangChainIntegration }

packages/core/src/js/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,14 @@ export {
5454
instrumentAnthropicAiClient,
5555
instrumentGoogleGenAIClient,
5656
createLangChainCallbackHandler,
57-
instrumentLangGraph,
57+
instrumentStateGraph,
5858
instrumentStateGraphCompile,
5959
addConsoleInstrumentationFilter,
6060
} from '@sentry/core';
6161

62+
/** @deprecated Use `instrumentStateGraph` instead. `instrumentLangGraph` will be removed in a future major version. */
63+
export { instrumentLangGraph } from '@sentry/core';
64+
6265
export type {
6366
OpenAiClient,
6467
OpenAiOptions,

packages/core/test/aiExports.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@ describe('AI SDK manual instrumentation re-exports', () => {
66
'instrumentAnthropicAiClient',
77
'instrumentGoogleGenAIClient',
88
'createLangChainCallbackHandler',
9+
'instrumentStateGraph',
910
'instrumentLangGraph',
1011
'instrumentStateGraphCompile',
1112
])('re-exports %s from @sentry/core', name => {
1213
expect(typeof (Sentry as Record<string, unknown>)[name]).toBe('function');
1314
});
15+
16+
test('deprecated instrumentLangGraph is an alias of instrumentStateGraph', () => {
17+
expect(Sentry.instrumentLangGraph).toBe(Sentry.instrumentStateGraph);
18+
});
1419
});

0 commit comments

Comments
 (0)