MCPcopy Create free account
hub / github.com/getsentry/sentry-javascript / shouldEnableTruncation

Function shouldEnableTruncation

packages/core/src/tracing/ai/utils.ts:68–79  ·  view source on GitHub ↗
(enableTruncation: boolean | undefined)

Source from the content-addressed store, hash-verified

66 * message data can be retained. `streamGenAiSpans` is opt-out (on unless explicitly set to `false`).
67 */
68export function shouldEnableTruncation(enableTruncation: boolean | undefined): boolean {
69 if (enableTruncation !== undefined) {
70 return enableTruncation;
71 }
72
73 const client = getClient();
74 if (!client) {
75 return true;
76 }
77
78 return !hasSpanStreamingEnabled(client) && client.getOptions().streamGenAiSpans === false;
79}
80
81/**
82 * Build method path from current traversal

Callers 9

getRecordingOptionsFunction · 0.90
utils.test.tsFile · 0.90
applyFunction · 0.90
applyFunction · 0.90
instrumentMethodFunction · 0.90
handleStreamingRequestFunction · 0.90
applyFunction · 0.90
onVercelAiSpanStartFunction · 0.90

Calls 3

getClientFunction · 0.90
hasSpanStreamingEnabledFunction · 0.90
getOptionsMethod · 0.65

Tested by

no test coverage detected