Skip to content

Commit

Permalink
fix(replays): Cap replay event size by setting bag-size for unsized f…
Browse files Browse the repository at this point in the history
  • Loading branch information
cmanallen committed Oct 11, 2023
1 parent 4c0acae commit d469f9c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions relay-event-schema/src/protocol/replay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ pub struct Replay {
/// "replay_type": "session"
/// }
/// ```
#[metastructure(max_chars = "environment")]
pub replay_type: Annotated<String>,

/// Segment identifier.
Expand Down Expand Up @@ -134,9 +135,11 @@ pub struct Replay {
pub urls: Annotated<Array<String>>,

/// A list of error-ids discovered during the lifetime of the segment.
#[metastructure(bag_size = "medium")]
pub error_ids: Annotated<Array<String>>,

/// A list of trace-ids discovered during the lifetime of the segment.
#[metastructure(bag_size = "medium")]
pub trace_ids: Annotated<Array<String>>,

/// Contexts describing the environment (e.g. device, os or browser).
Expand All @@ -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<String>,

/// The release version of the application.
Expand All @@ -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<String>,

Expand All @@ -197,7 +202,7 @@ pub struct Replay {
pub tags: Annotated<Tags>,

/// Static value. Should always be "replay_event".
#[metastructure(field = "type")]
#[metastructure(field = "type", max_chars = "environment")]
pub ty: Annotated<String>,

/// Information about the user who triggered this event.
Expand Down

0 comments on commit d469f9c

Please sign in to comment.