From d469f9c8fe1920b4da3000b5b9190fb3c0e24836 Mon Sep 17 00:00:00 2001 From: Colton Allen Date: Wed, 11 Oct 2023 09:54:55 -0500 Subject: [PATCH] fix(replays): Cap replay event size by setting bag-size for unsized fields (#2585) Ref: https://sentry.my.sentry.io/organizations/sentry/issues/396171/?referrer=slack #skip-changelog --- relay-event-schema/src/protocol/replay.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/relay-event-schema/src/protocol/replay.rs b/relay-event-schema/src/protocol/replay.rs index b5475318df..5847413140 100644 --- a/relay-event-schema/src/protocol/replay.rs +++ b/relay-event-schema/src/protocol/replay.rs @@ -82,6 +82,7 @@ pub struct Replay { /// "replay_type": "session" /// } /// ``` + #[metastructure(max_chars = "environment")] pub replay_type: Annotated, /// Segment identifier. @@ -134,9 +135,11 @@ pub struct Replay { pub urls: Annotated>, /// A list of error-ids discovered during the lifetime of the segment. + #[metastructure(bag_size = "medium")] pub error_ids: Annotated>, /// A list of trace-ids discovered during the lifetime of the segment. + #[metastructure(bag_size = "medium")] pub trace_ids: Annotated>, /// Contexts describing the environment (e.g. device, os or browser). @@ -147,6 +150,7 @@ pub struct Replay { /// /// A string representing the platform the SDK is submitting from. This will be used by the /// Sentry interface to customize various components in the interface. + #[metastructure(max_chars = "environment")] pub platform: Annotated, /// The release version of the application. @@ -173,7 +177,8 @@ pub struct Replay { allow_chars = "a-zA-Z0-9_.-", trim_whitespace = "true", required = "false", - nonempty = "true" + nonempty = "true", + max_chars = "environment" )] pub dist: Annotated, @@ -197,7 +202,7 @@ pub struct Replay { pub tags: Annotated, /// Static value. Should always be "replay_event". - #[metastructure(field = "type")] + #[metastructure(field = "type", max_chars = "environment")] pub ty: Annotated, /// Information about the user who triggered this event.