Skip to content

Commit 4f71c94

Browse files
authored
ref(core): Move ai integrations from utils to tracing (#18185)
As discussed moving the AI integrations from core/utils to core/tracing.
1 parent 2406e90 commit 4f71c94

30 files changed

+20
-20
lines changed

packages/core/src/index.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -140,31 +140,31 @@ export {
140140
export * as metrics from './metrics/public-api';
141141
export type { MetricOptions } from './metrics/public-api';
142142
export { createConsolaReporter } from './integrations/consola';
143-
export { addVercelAiProcessors } from './utils/vercel-ai';
144-
export { _INTERNAL_getSpanForToolCallId, _INTERNAL_cleanupToolCallSpan } from './utils/vercel-ai/utils';
145-
export { instrumentOpenAiClient } from './utils/openai';
146-
export { OPENAI_INTEGRATION_NAME } from './utils/openai/constants';
147-
export { instrumentAnthropicAiClient } from './utils/anthropic-ai';
148-
export { ANTHROPIC_AI_INTEGRATION_NAME } from './utils/anthropic-ai/constants';
149-
export { instrumentGoogleGenAIClient } from './utils/google-genai';
150-
export { GOOGLE_GENAI_INTEGRATION_NAME } from './utils/google-genai/constants';
151-
export type { GoogleGenAIResponse } from './utils/google-genai/types';
152-
export { createLangChainCallbackHandler } from './utils/langchain';
153-
export { LANGCHAIN_INTEGRATION_NAME } from './utils/langchain/constants';
154-
export type { LangChainOptions, LangChainIntegration } from './utils/langchain/types';
155-
export type { OpenAiClient, OpenAiOptions, InstrumentedMethod } from './utils/openai/types';
143+
export { addVercelAiProcessors } from './tracing/vercel-ai';
144+
export { _INTERNAL_getSpanForToolCallId, _INTERNAL_cleanupToolCallSpan } from './tracing/vercel-ai/utils';
145+
export { instrumentOpenAiClient } from './tracing/openai';
146+
export { OPENAI_INTEGRATION_NAME } from './tracing/openai/constants';
147+
export { instrumentAnthropicAiClient } from './tracing/anthropic-ai';
148+
export { ANTHROPIC_AI_INTEGRATION_NAME } from './tracing/anthropic-ai/constants';
149+
export { instrumentGoogleGenAIClient } from './tracing/google-genai';
150+
export { GOOGLE_GENAI_INTEGRATION_NAME } from './tracing/google-genai/constants';
151+
export type { GoogleGenAIResponse } from './tracing/google-genai/types';
152+
export { createLangChainCallbackHandler } from './tracing/langchain';
153+
export { LANGCHAIN_INTEGRATION_NAME } from './tracing/langchain/constants';
154+
export type { LangChainOptions, LangChainIntegration } from './tracing/langchain/types';
155+
export type { OpenAiClient, OpenAiOptions, InstrumentedMethod } from './tracing/openai/types';
156156
export type {
157157
AnthropicAiClient,
158158
AnthropicAiOptions,
159159
AnthropicAiInstrumentedMethod,
160160
AnthropicAiResponse,
161-
} from './utils/anthropic-ai/types';
161+
} from './tracing/anthropic-ai/types';
162162
export type {
163163
GoogleGenAIClient,
164164
GoogleGenAIChat,
165165
GoogleGenAIOptions,
166166
GoogleGenAIIstrumentedMethod,
167-
} from './utils/google-genai/types';
167+
} from './tracing/google-genai/types';
168168
export type { FeatureFlag } from './utils/featureFlags';
169169

170170
export {
File renamed without changes.

packages/core/src/utils/anthropic-ai/index.ts renamed to packages/core/src/tracing/anthropic-ai/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '../../semanticAttributes';
44
import { SPAN_STATUS_ERROR } from '../../tracing';
55
import { startSpan, startSpanManual } from '../../tracing/trace';
66
import type { Span, SpanAttributeValue } from '../../types-hoist/span';
7+
import { handleCallbackErrors } from '../../utils/handleCallbackErrors';
78
import {
89
ANTHROPIC_AI_RESPONSE_TIMESTAMP_ATTRIBUTE,
910
GEN_AI_OPERATION_NAME_ATTRIBUTE,
@@ -30,7 +31,6 @@ import {
3031
getTruncatedJsonString,
3132
setTokenUsageAttributes,
3233
} from '../ai/utils';
33-
import { handleCallbackErrors } from '../handleCallbackErrors';
3434
import { instrumentAsyncIterableStream, instrumentMessageStream } from './streaming';
3535
import type {
3636
AnthropicAiInstrumentedMethod,

0 commit comments

Comments
 (0)