-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Description
Description
Data should not be truncated in the SDK itself, but in Relay.
Reference: https://github.com/getsentry/projects/issues/837
Exceptions:
- 1000 spans per transaction
- max number of breadcrumbs
- request body truncation
Going through the repository, several places were found where truncation happens:
Normalizing objects
- Truncating by depth and breath, configurable with
normalizeMaxBreadth
andnormalizeDepth
export function normalize(input: unknown, depth: number = 100, maxProperties: number = +Infinity): any { |
Limiting Values
- Maximum value length, configurable with
maxValueLength
const { environment, release, dist, maxValueLength = 250 } = options; |
Context lines
- Trims context lines
export function snipLine(line: string, colno: number): string { |
Exceptions
- Truncates key length, extra error data
export function extractExceptionKeysForMessage(exception: Record<string, unknown>, maxLength: number = 40): string { |
extraErrorInfo[key] = isError(value) || typeof value === 'string' ? truncate(`${value}`, maxValueLength) : value; |
Limiting Zod Errors
- Zod integration limits amount of issues attached (configurable)
export function applyZodErrorsToEvent( |
Breadcrumbs
- Maximum number of breadcrumbs is 100 (this should probably stay)
sentry-javascript/packages/core/src/scope.ts
Line 483 in 1b41126
this._breadcrumbs = this._breadcrumbs.slice(-maxCrumbs); |
Feature Flags
- Maximum flags per span
- Maximum flags stored in the buffer
if (numOfAddedFlags < maxFlagsPerSpan) {
HTTP integration
- Truncates body, configurable with
maxIncomingRequestBodySize
sentry-javascript/packages/node-core/src/integrations/http/SentryHttpInstrumentation.ts
Lines 553 to 558 in 99360ba
const truncatedBody = bodyByteLength > maxBodySize ? `${Buffer.from(body) .subarray(0, maxBodySize - 3) .toString('utf-8')}...` : body;
Redis integration
- Truncates span description (not configurable)
span.updateName(truncate(spanDescription, 1024)); |
Paths
- Trims path length for directories, LCP URLs
const truncated = filename.length > 1024 ? `<truncated>${filename.slice(-1024)}` : filename; |
entry.url && (attributes['lcp.url'] = entry.url.trim().slice(0, 200)); |
return url.slice(0, 1024); |
Metadata
Metadata
Assignees
Labels
No labels