@sentry/core 10.48.0 → 10.49.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/build/cjs/fetch.js +36 -17
  2. package/build/cjs/fetch.js.map +1 -1
  3. package/build/cjs/index.js +9 -5
  4. package/build/cjs/index.js.map +1 -1
  5. package/build/cjs/integrations/conversationId.js +11 -0
  6. package/build/cjs/integrations/conversationId.js.map +1 -1
  7. package/build/cjs/integrations/express/index.js +44 -7
  8. package/build/cjs/integrations/express/index.js.map +1 -1
  9. package/build/cjs/integrations/express/patch-layer.js +7 -1
  10. package/build/cjs/integrations/express/patch-layer.js.map +1 -1
  11. package/build/cjs/integrations/express/types.js.map +1 -1
  12. package/build/cjs/integrations/requestdata.js.map +1 -1
  13. package/build/cjs/tracing/ai/gen-ai-attributes.js +0 -30
  14. package/build/cjs/tracing/ai/gen-ai-attributes.js.map +1 -1
  15. package/build/cjs/tracing/ai/utils.js +24 -0
  16. package/build/cjs/tracing/ai/utils.js.map +1 -1
  17. package/build/cjs/tracing/anthropic-ai/index.js +5 -5
  18. package/build/cjs/tracing/anthropic-ai/index.js.map +1 -1
  19. package/build/cjs/tracing/anthropic-ai/utils.js +4 -2
  20. package/build/cjs/tracing/anthropic-ai/utils.js.map +1 -1
  21. package/build/cjs/tracing/google-genai/index.js +16 -5
  22. package/build/cjs/tracing/google-genai/index.js.map +1 -1
  23. package/build/cjs/tracing/langchain/index.js +3 -0
  24. package/build/cjs/tracing/langchain/index.js.map +1 -1
  25. package/build/cjs/tracing/langchain/utils.js +12 -4
  26. package/build/cjs/tracing/langchain/utils.js.map +1 -1
  27. package/build/cjs/tracing/langgraph/index.js +4 -3
  28. package/build/cjs/tracing/langgraph/index.js.map +1 -1
  29. package/build/cjs/tracing/openai/index.js +12 -5
  30. package/build/cjs/tracing/openai/index.js.map +1 -1
  31. package/build/cjs/tracing/utils.js +3 -37
  32. package/build/cjs/tracing/utils.js.map +1 -1
  33. package/build/cjs/tracing/vercel-ai/constants.js +15 -23
  34. package/build/cjs/tracing/vercel-ai/constants.js.map +1 -1
  35. package/build/cjs/tracing/vercel-ai/index.js +32 -45
  36. package/build/cjs/tracing/vercel-ai/index.js.map +1 -1
  37. package/build/cjs/tracing/vercel-ai/utils.js +11 -39
  38. package/build/cjs/tracing/vercel-ai/utils.js.map +1 -1
  39. package/build/cjs/tracing/vercel-ai/vercel-ai-attributes.js +4 -1
  40. package/build/cjs/tracing/vercel-ai/vercel-ai-attributes.js.map +1 -1
  41. package/build/cjs/utils/browser.js +2 -3
  42. package/build/cjs/utils/browser.js.map +1 -1
  43. package/build/cjs/utils/version.js +1 -1
  44. package/build/cjs/utils/weakRef.js +62 -0
  45. package/build/cjs/utils/weakRef.js.map +1 -0
  46. package/build/esm/fetch.js +36 -17
  47. package/build/esm/fetch.js.map +1 -1
  48. package/build/esm/index.js +2 -1
  49. package/build/esm/index.js.map +1 -1
  50. package/build/esm/integrations/conversationId.js +11 -0
  51. package/build/esm/integrations/conversationId.js.map +1 -1
  52. package/build/esm/integrations/express/index.js +44 -7
  53. package/build/esm/integrations/express/index.js.map +1 -1
  54. package/build/esm/integrations/express/patch-layer.js +7 -1
  55. package/build/esm/integrations/express/patch-layer.js.map +1 -1
  56. package/build/esm/integrations/express/types.js.map +1 -1
  57. package/build/esm/integrations/requestdata.js.map +1 -1
  58. package/build/esm/package.json +1 -1
  59. package/build/esm/tracing/ai/gen-ai-attributes.js +1 -26
  60. package/build/esm/tracing/ai/gen-ai-attributes.js.map +1 -1
  61. package/build/esm/tracing/ai/utils.js +23 -1
  62. package/build/esm/tracing/ai/utils.js.map +1 -1
  63. package/build/esm/tracing/anthropic-ai/index.js +6 -6
  64. package/build/esm/tracing/anthropic-ai/index.js.map +1 -1
  65. package/build/esm/tracing/anthropic-ai/utils.js +5 -3
  66. package/build/esm/tracing/anthropic-ai/utils.js.map +1 -1
  67. package/build/esm/tracing/google-genai/index.js +17 -6
  68. package/build/esm/tracing/google-genai/index.js.map +1 -1
  69. package/build/esm/tracing/langchain/index.js +4 -1
  70. package/build/esm/tracing/langchain/index.js.map +1 -1
  71. package/build/esm/tracing/langchain/utils.js +13 -5
  72. package/build/esm/tracing/langchain/utils.js.map +1 -1
  73. package/build/esm/tracing/langgraph/index.js +5 -4
  74. package/build/esm/tracing/langgraph/index.js.map +1 -1
  75. package/build/esm/tracing/openai/index.js +13 -6
  76. package/build/esm/tracing/openai/index.js.map +1 -1
  77. package/build/esm/tracing/utils.js +3 -37
  78. package/build/esm/tracing/utils.js.map +1 -1
  79. package/build/esm/tracing/vercel-ai/constants.js +15 -19
  80. package/build/esm/tracing/vercel-ai/constants.js.map +1 -1
  81. package/build/esm/tracing/vercel-ai/index.js +29 -42
  82. package/build/esm/tracing/vercel-ai/index.js.map +1 -1
  83. package/build/esm/tracing/vercel-ai/utils.js +14 -41
  84. package/build/esm/tracing/vercel-ai/utils.js.map +1 -1
  85. package/build/esm/tracing/vercel-ai/vercel-ai-attributes.js +4 -1
  86. package/build/esm/tracing/vercel-ai/vercel-ai-attributes.js.map +1 -1
  87. package/build/esm/utils/browser.js +2 -3
  88. package/build/esm/utils/browser.js.map +1 -1
  89. package/build/esm/utils/version.js +1 -1
  90. package/build/esm/utils/weakRef.js +59 -0
  91. package/build/esm/utils/weakRef.js.map +1 -0
  92. package/build/types/build-time-plugins/buildTimeOptionsBase.d.ts +13 -0
  93. package/build/types/build-time-plugins/buildTimeOptionsBase.d.ts.map +1 -1
  94. package/build/types/fetch.d.ts +12 -8
  95. package/build/types/fetch.d.ts.map +1 -1
  96. package/build/types/index.d.ts +4 -1
  97. package/build/types/index.d.ts.map +1 -1
  98. package/build/types/integrations/conversationId.d.ts.map +1 -1
  99. package/build/types/integrations/express/index.d.ts +10 -3
  100. package/build/types/integrations/express/index.d.ts.map +1 -1
  101. package/build/types/integrations/express/patch-layer.d.ts +1 -1
  102. package/build/types/integrations/express/patch-layer.d.ts.map +1 -1
  103. package/build/types/integrations/express/types.d.ts +5 -1
  104. package/build/types/integrations/express/types.d.ts.map +1 -1
  105. package/build/types/integrations/requestdata.d.ts.map +1 -1
  106. package/build/types/tracing/ai/gen-ai-attributes.d.ts +0 -8
  107. package/build/types/tracing/ai/gen-ai-attributes.d.ts.map +1 -1
  108. package/build/types/tracing/ai/utils.d.ts +11 -0
  109. package/build/types/tracing/ai/utils.d.ts.map +1 -1
  110. package/build/types/tracing/anthropic-ai/index.d.ts.map +1 -1
  111. package/build/types/tracing/anthropic-ai/types.d.ts +5 -0
  112. package/build/types/tracing/anthropic-ai/types.d.ts.map +1 -1
  113. package/build/types/tracing/anthropic-ai/utils.d.ts +1 -1
  114. package/build/types/tracing/anthropic-ai/utils.d.ts.map +1 -1
  115. package/build/types/tracing/google-genai/index.d.ts.map +1 -1
  116. package/build/types/tracing/google-genai/types.d.ts +5 -0
  117. package/build/types/tracing/google-genai/types.d.ts.map +1 -1
  118. package/build/types/tracing/langchain/index.d.ts.map +1 -1
  119. package/build/types/tracing/langchain/types.d.ts +5 -0
  120. package/build/types/tracing/langchain/types.d.ts.map +1 -1
  121. package/build/types/tracing/langchain/utils.d.ts +2 -2
  122. package/build/types/tracing/langchain/utils.d.ts.map +1 -1
  123. package/build/types/tracing/langgraph/index.d.ts.map +1 -1
  124. package/build/types/tracing/langgraph/types.d.ts +5 -0
  125. package/build/types/tracing/langgraph/types.d.ts.map +1 -1
  126. package/build/types/tracing/openai/index.d.ts.map +1 -1
  127. package/build/types/tracing/openai/types.d.ts +5 -0
  128. package/build/types/tracing/openai/types.d.ts.map +1 -1
  129. package/build/types/tracing/utils.d.ts.map +1 -1
  130. package/build/types/tracing/vercel-ai/constants.d.ts +2 -5
  131. package/build/types/tracing/vercel-ai/constants.d.ts.map +1 -1
  132. package/build/types/tracing/vercel-ai/index.d.ts.map +1 -1
  133. package/build/types/tracing/vercel-ai/utils.d.ts +1 -5
  134. package/build/types/tracing/vercel-ai/utils.d.ts.map +1 -1
  135. package/build/types/tracing/vercel-ai/vercel-ai-attributes.d.ts +0 -480
  136. package/build/types/tracing/vercel-ai/vercel-ai-attributes.d.ts.map +1 -1
  137. package/build/types/types-hoist/view-hierarchy.d.ts +1 -0
  138. package/build/types/types-hoist/view-hierarchy.d.ts.map +1 -1
  139. package/build/types/utils/browser.d.ts +1 -1
  140. package/build/types/utils/browser.d.ts.map +1 -1
  141. package/build/types/utils/weakRef.d.ts +34 -0
  142. package/build/types/utils/weakRef.d.ts.map +1 -0
  143. package/build/types-ts3.8/build-time-plugins/buildTimeOptionsBase.d.ts +13 -0
  144. package/build/types-ts3.8/fetch.d.ts +14 -10
  145. package/build/types-ts3.8/index.d.ts +4 -1
  146. package/build/types-ts3.8/integrations/express/index.d.ts +10 -3
  147. package/build/types-ts3.8/integrations/express/patch-layer.d.ts +1 -1
  148. package/build/types-ts3.8/integrations/express/types.d.ts +5 -1
  149. package/build/types-ts3.8/tracing/ai/gen-ai-attributes.d.ts +0 -8
  150. package/build/types-ts3.8/tracing/ai/utils.d.ts +11 -0
  151. package/build/types-ts3.8/tracing/anthropic-ai/types.d.ts +5 -0
  152. package/build/types-ts3.8/tracing/anthropic-ai/utils.d.ts +1 -1
  153. package/build/types-ts3.8/tracing/google-genai/types.d.ts +5 -0
  154. package/build/types-ts3.8/tracing/langchain/types.d.ts +5 -0
  155. package/build/types-ts3.8/tracing/langchain/utils.d.ts +2 -2
  156. package/build/types-ts3.8/tracing/langgraph/types.d.ts +5 -0
  157. package/build/types-ts3.8/tracing/openai/types.d.ts +5 -0
  158. package/build/types-ts3.8/tracing/vercel-ai/constants.d.ts +2 -5
  159. package/build/types-ts3.8/tracing/vercel-ai/utils.d.ts +1 -5
  160. package/build/types-ts3.8/tracing/vercel-ai/vercel-ai-attributes.d.ts +0 -480
  161. package/build/types-ts3.8/types-hoist/view-hierarchy.d.ts +1 -0
  162. package/build/types-ts3.8/utils/browser.d.ts +1 -1
  163. package/build/types-ts3.8/utils/weakRef.d.ts +34 -0
  164. package/package.json +1 -1
@@ -1,10 +1,10 @@
1
1
  import { HandlerDataFetch } from './types-hoist/instrument';
2
2
  import { ResponseHookInfo } from './types-hoist/request';
3
3
  import { Span, SpanOrigin } from './types-hoist/span';
4
- type PolymorphicRequestHeaders = Record<string, string | undefined> | Array<[
4
+ type PolymorphicRequestHeaders = Record<string, unknown> | Array<[
5
5
  string,
6
- string
7
- ]> | {
6
+ unknown
7
+ ]> | Iterable<Iterable<unknown>> | {
8
8
  append: (key: string, value: string) => void;
9
9
  get: (key: string) => string | null | undefined;
10
10
  };
@@ -32,15 +32,19 @@ export declare function instrumentFetchRequest(handlerData: HandlerDataFetch, sh
32
32
  */
33
33
  export declare function _callOnRequestSpanEnd(span: Span, handlerData: HandlerDataFetch, spanOriginOrOptions?: SpanOrigin | InstrumentFetchRequestOptions): void;
34
34
  /**
35
- * Adds sentry-trace and baggage headers to the various forms of fetch headers.
36
- * exported only for testing purposes
35
+ * Builds merged fetch headers that include `sentry-trace` and `baggage` (and optionally `traceparent`)
36
+ * for the given request and init, without mutating the original request or options.
37
+ * Returns `undefined` when there is no `sentry-trace` value to attach.
37
38
  *
38
- * When we determine if we should add a baggage header, there are 3 cases:
39
- * 1. No previous baggage header -> add baggage
40
- * 2. Previous baggage header has no sentry baggage values -> add our baggage
41
- * 3. Previous baggage header has sentry baggage values -> do nothing (might have been added manually by users)
39
+ * @internal Exported for cross-package instrumentation (for example Cloudflare Workers fetcher bindings)
40
+ * and unit tests
41
+ *
42
+ * Baggage handling:
43
+ * 1. No previous baggage header → include Sentry baggage
44
+ * 2. Previous baggage has no Sentry entries → merge Sentry baggage in
45
+ * 3. Previous baggage already has Sentry entries → leave as-is (may be user-defined)
42
46
  */
43
- export declare function _addTracingHeadersToFetchRequest(request: string | Request, fetchOptionsObj: {
47
+ export declare function _INTERNAL_getTracingHeadersForFetchRequest(request: string | URL | Request, fetchOptionsObj: {
44
48
  headers?: {
45
49
  [key: string]: string[] | string | undefined;
46
50
  } | PolymorphicRequestHeaders;
@@ -48,6 +48,8 @@ export { getTraceData } from './utils/traceData';
48
48
  export { shouldPropagateTraceForUrl } from './utils/tracePropagationTargets';
49
49
  export { getTraceMetaTags } from './utils/meta';
50
50
  export { debounce } from './utils/debounce';
51
+ export { makeWeakRef, derefWeakRef } from './utils/weakRef';
52
+ export { MaybeWeakRef } from './utils/weakRef';
51
53
  export { shouldIgnoreSpan } from './utils/should-ignore-span';
52
54
  export { winterCGHeadersToDict, winterCGRequestToRequestData, httpRequestToRequestData, extractQueryParamsFromUrl, headersToDict, httpHeadersToSpanAttributes, } from './utils/request';
53
55
  export { DEFAULT_ENVIRONMENT, DEV_ENVIRONMENT } from './constants';
@@ -73,7 +75,7 @@ export { featureFlagsIntegration, FeatureFlagsIntegration } from './integrations
73
75
  export { growthbookIntegration } from './integrations/featureFlags';
74
76
  export { conversationIdIntegration } from './integrations/conversationId';
75
77
  export { profiler } from './profiling';
76
- export { instrumentFetchRequest } from './fetch';
78
+ export { instrumentFetchRequest, _INTERNAL_getTracingHeadersForFetchRequest } from './fetch';
77
79
  export { trpcMiddleware } from './trpc';
78
80
  export { wrapMcpServerWithSentry } from './integrations/mcp-server';
79
81
  export { captureFeedback } from './feedback';
@@ -192,6 +194,7 @@ export { SeverityLevel } from './types-hoist/severity';
192
194
  export { Span, SentrySpanArguments, SpanOrigin, SpanAttributeValue, SpanAttributes, SpanTimeInput, SpanJSON, SpanContextData, TraceFlag, SerializedStreamedSpan, SerializedStreamedSpanContainer, StreamedSpanJSON, } from './types-hoist/span';
193
195
  export { SpanStatus } from './types-hoist/spanStatus';
194
196
  export { Log, LogSeverityLevel } from './types-hoist/log';
197
+ export { SpanLink } from './types-hoist/link';
195
198
  export { Metric, MetricType, SerializedMetric, SerializedMetricContainer, SerializedMetricAttributeValue, } from './types-hoist/metric';
196
199
  export { TimedEvent } from './types-hoist/timedEvent';
197
200
  export { StackFrame } from './types-hoist/stackframe';
@@ -26,7 +26,7 @@
26
26
  * See the License for the specific language governing permissions and
27
27
  * limitations under the License.
28
28
  */
29
- import { ExpressErrorMiddleware, ExpressExport, ExpressHandlerOptions, ExpressIntegrationOptions } from './types';
29
+ import { ExpressErrorMiddleware, ExpressHandlerOptions, ExpressIntegrationOptions, ExpressModuleExport } from './types';
30
30
  /**
31
31
  * This is a portable instrumentatiton function that works in any environment
32
32
  * where Express can be loaded, without depending on OpenTelemetry.
@@ -36,9 +36,16 @@ import { ExpressErrorMiddleware, ExpressExport, ExpressHandlerOptions, ExpressIn
36
36
  * import express from 'express';
37
37
  * import * as Sentry from '@sentry/deno'; // or any SDK that extends core
38
38
  *
39
- * Sentry.patchExpressModule({ express })
39
+ * Sentry.patchExpressModule(express, () => ({}));
40
+ * ```
41
+ */
42
+ export declare function patchExpressModule(moduleExports: ExpressModuleExport, getOptions: () => ExpressIntegrationOptions): ExpressModuleExport;
43
+ /**
44
+ * @deprecated Pass the Express module export as the first argument and options getter as the second argument.
40
45
  */
41
- export declare const patchExpressModule: (options: ExpressIntegrationOptions) => ExpressExport;
46
+ export declare function patchExpressModule(options: ExpressIntegrationOptions & {
47
+ express: ExpressModuleExport;
48
+ }): ExpressModuleExport;
42
49
  /**
43
50
  * An Express-compatible error handler, used by setupExpressErrorHandler
44
51
  */
@@ -28,5 +28,5 @@
28
28
  */
29
29
  import { ExpressIntegrationOptions, ExpressLayer } from './types';
30
30
  export type ExpressPatchLayerOptions = Pick<ExpressIntegrationOptions, 'onRouteResolved' | 'ignoreLayers' | 'ignoreLayersType'>;
31
- export declare function patchLayer(options: ExpressPatchLayerOptions, maybeLayer?: ExpressLayer, layerPath?: string): void;
31
+ export declare function patchLayer(getOptions: () => ExpressPatchLayerOptions, maybeLayer?: ExpressLayer, layerPath?: string): void;
32
32
  //# sourceMappingURL=patch-layer.d.ts.map
@@ -114,7 +114,11 @@ export type ExpressRouter = {
114
114
  };
115
115
  export type IgnoreMatcher = string | RegExp | ((name: string) => boolean);
116
116
  export type ExpressIntegrationOptions = {
117
- express: ExpressModuleExport;
117
+ /**
118
+ * @deprecated Pass the express module as the first argument, and an
119
+ * options getter as the second argument to patchExpressModule.
120
+ */
121
+ express?: ExpressModuleExport;
118
122
  /** Ignore specific based on their name */
119
123
  ignoreLayers?: IgnoreMatcher[];
120
124
  /** Ignore specific layers based on their type */
@@ -177,14 +177,6 @@ export declare const GEN_AI_EMBEDDINGS_INPUT_ATTRIBUTE = "gen_ai.embeddings.inpu
177
177
  * The span operation for embeddings
178
178
  */
179
179
  export declare const GEN_AI_EMBEDDINGS_OPERATION_ATTRIBUTE = "gen_ai.embeddings";
180
- /**
181
- * The span operation name for embedding
182
- */
183
- export declare const GEN_AI_EMBED_DO_EMBED_OPERATION_ATTRIBUTE = "gen_ai.embeddings";
184
- /**
185
- * The span operation name for embedding many
186
- */
187
- export declare const GEN_AI_EMBED_MANY_DO_EMBED_OPERATION_ATTRIBUTE = "gen_ai.embeddings";
188
180
  /**
189
181
  * The span operation name for reranking
190
182
  */
@@ -26,6 +26,12 @@ export type InstrumentedMethodRegistry = Record<string, InstrumentedMethodEntry>
26
26
  * Precedence: explicit option > sendDefaultPii > false
27
27
  */
28
28
  export declare function resolveAIRecordingOptions<T extends AIRecordingOptions>(options?: T): T & Required<AIRecordingOptions>;
29
+ /**
30
+ * Resolves whether truncation should be enabled.
31
+ * If the user explicitly set `enableTruncation`, that value is used.
32
+ * Otherwise, truncation is disabled when span streaming is active.
33
+ */
34
+ export declare function shouldEnableTruncation(enableTruncation: boolean | undefined): boolean;
29
35
  /**
30
36
  * Build method path from current traversal
31
37
  */
@@ -56,6 +62,11 @@ export interface StreamResponseState {
56
62
  * Shared across OpenAI, Anthropic, and Google GenAI streaming implementations.
57
63
  */
58
64
  export declare function endStreamSpan(span: Span, state: StreamResponseState, recordOutputs: boolean): void;
65
+ /**
66
+ * Serialize a value to a JSON string without truncation.
67
+ * Strings are returned as-is, arrays and objects are JSON-stringified.
68
+ */
69
+ export declare function getJsonString<T>(value: T | T[]): string;
59
70
  /**
60
71
  * Get the truncated JSON string for a string or array of strings.
61
72
  *
@@ -8,6 +8,11 @@ export interface AnthropicAiOptions {
8
8
  * Enable or disable output recording.
9
9
  */
10
10
  recordOutputs?: boolean;
11
+ /**
12
+ * Enable or disable truncation of recorded input messages.
13
+ * Defaults to `true`.
14
+ */
15
+ enableTruncation?: boolean;
11
16
  }
12
17
  export type Message = {
13
18
  role: 'user' | 'assistant';
@@ -5,7 +5,7 @@ import { AnthropicAiResponse } from './types';
5
5
  * Set the messages and messages original length attributes.
6
6
  * Extracts system instructions before truncation.
7
7
  */
8
- export declare function setMessagesAttribute(span: Span, messages: unknown): void;
8
+ export declare function setMessagesAttribute(span: Span, messages: unknown, enableTruncation: boolean): void;
9
9
  /**
10
10
  * Map an Anthropic API error type to a SpanStatusType value.
11
11
  * @see https://docs.anthropic.com/en/api/errors#error-shapes
@@ -8,6 +8,11 @@ export interface GoogleGenAIOptions {
8
8
  * Enable or disable output recording.
9
9
  */
10
10
  recordOutputs?: boolean;
11
+ /**
12
+ * Enable or disable truncation of recorded input messages.
13
+ * Defaults to `true`.
14
+ */
15
+ enableTruncation?: boolean;
11
16
  }
12
17
  /**
13
18
  * Google GenAI Content Part
@@ -12,6 +12,11 @@ export interface LangChainOptions {
12
12
  * @default false (respects sendDefaultPii option)
13
13
  */
14
14
  recordOutputs?: boolean;
15
+ /**
16
+ * Enable or disable truncation of recorded input messages.
17
+ * Defaults to `true`.
18
+ */
19
+ enableTruncation?: boolean;
15
20
  }
16
21
  /**
17
22
  * LangChain Serialized type (compatible with @langchain/core)
@@ -36,7 +36,7 @@ export declare function normalizeLangChainMessages(messages: LangChainMessage[])
36
36
  * - When `recordInputs` is true, string prompts are wrapped into `{role:"user"}`
37
37
  * messages to align with the chat schema used elsewhere.
38
38
  */
39
- export declare function extractLLMRequestAttributes(llm: LangChainSerialized, prompts: string[], recordInputs: boolean, invocationParams?: Record<string, unknown>, langSmithMetadata?: Record<string, unknown>): Record<string, SpanAttributeValue>;
39
+ export declare function extractLLMRequestAttributes(llm: LangChainSerialized, prompts: string[], recordInputs: boolean, enableTruncation: boolean, invocationParams?: Record<string, unknown>, langSmithMetadata?: Record<string, unknown>): Record<string, SpanAttributeValue>;
40
40
  /**
41
41
  * Extracts attributes for ChatModel invocations (array-of-arrays of messages).
42
42
  *
@@ -46,7 +46,7 @@ export declare function extractLLMRequestAttributes(llm: LangChainSerialized, pr
46
46
  * consistent `{ role, content }` array when `recordInputs` is true.
47
47
  * - Provider system value falls back to `serialized.id?.[2]`.
48
48
  */
49
- export declare function extractChatModelRequestAttributes(llm: LangChainSerialized, langChainMessages: LangChainMessage[][], recordInputs: boolean, invocationParams?: Record<string, unknown>, langSmithMetadata?: Record<string, unknown>): Record<string, SpanAttributeValue>;
49
+ export declare function extractChatModelRequestAttributes(llm: LangChainSerialized, langChainMessages: LangChainMessage[][], recordInputs: boolean, enableTruncation: boolean, invocationParams?: Record<string, unknown>, langSmithMetadata?: Record<string, unknown>): Record<string, SpanAttributeValue>;
50
50
  /**
51
51
  * Extracts response-related attributes based on a `LangChainLLMResult`.
52
52
  *
@@ -7,6 +7,11 @@ export interface LangGraphOptions {
7
7
  * Enable or disable output recording.
8
8
  */
9
9
  recordOutputs?: boolean;
10
+ /**
11
+ * Enable or disable truncation of recorded input messages.
12
+ * Defaults to `true`.
13
+ */
14
+ enableTruncation?: boolean;
10
15
  }
11
16
  /**
12
17
  * LangGraph Tool definition from lc_kwargs
@@ -14,6 +14,11 @@ export interface OpenAiOptions {
14
14
  * Enable or disable output recording.
15
15
  */
16
16
  recordOutputs?: boolean;
17
+ /**
18
+ * Enable or disable truncation of recorded input messages.
19
+ * Defaults to `true`.
20
+ */
21
+ enableTruncation?: boolean;
17
22
  }
18
23
  export interface OpenAiClient {
19
24
  responses?: {
@@ -1,8 +1,5 @@
1
1
  import { ToolCallSpanContext } from './types';
2
2
  export declare const toolCallSpanContextMap: Map<string, ToolCallSpanContext>;
3
- export declare const INVOKE_AGENT_OPS: Set<string>;
4
- export declare const GENERATE_CONTENT_OPS: Set<string>;
5
- export declare const EMBEDDINGS_OPS: Set<string>;
6
- export declare const RERANK_OPS: Set<string>;
7
- export declare const DO_SPAN_NAME_PREFIX: Record<string, string>;
3
+ /** Maps Vercel AI span names to standardized OpenTelemetry operation names. */
4
+ export declare const SPAN_TO_OPERATION_NAME: Map<string, string>;
8
5
  //# sourceMappingURL=constants.d.ts.map
@@ -44,9 +44,5 @@ export declare function convertUserInputToMessagesFormat(userInput: string): {
44
44
  * Generate a request.messages JSON array from the prompt field in the
45
45
  * invoke_agent op
46
46
  */
47
- export declare function requestMessagesFromPrompt(span: Span, attributes: SpanAttributes): void;
48
- /**
49
- * Maps a Vercel AI span name to the corresponding Sentry op.
50
- */
51
- export declare function getSpanOpFromName(name: string): string | undefined;
47
+ export declare function requestMessagesFromPrompt(span: Span, attributes: SpanAttributes, enableTruncation: boolean): void;
52
48
  //# sourceMappingURL=utils.d.ts.map