Skip to content

Commit aa5e3ee

Browse files
feat: Add breadcrumb.origin (#4498)
Adds `origin` field based on https://develop.sentry.dev/sdk/data-model/event-payloads/breadcrumbs/ --------- Co-authored-by: David Herberth <[email protected]>
1 parent 0f1167f commit aa5e3ee

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
- Add support for view hierarchy attachment scrubbing. ([#4452](https://github.com/getsentry/relay/pull/4452))
3030
- Allow configuration of Relay's log format via an environment variable. ([#4484](https://github.com/getsentry/relay/pull/4484))
3131
- Add span links to event schema. ([#4486](https://github.com/getsentry/relay/pull/4486))
32+
- Add `breadcrumb.origin` field to event schema. ([#4498](https://github.com/getsentry/relay/pull/4498))
3233
- Add Spring context to event schema. ([#4502](https://github.com/getsentry/relay/pull/4502))
3334

3435
**Bug Fixes**:

relay-event-schema/src/protocol/breadcrumb.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,14 @@ pub struct Breadcrumb {
116116
#[metastructure(skip_serialization = "null")]
117117
pub event_id: Annotated<EventId>,
118118

119+
/// The origin of the breadcrumb.
120+
///
121+
/// A string representing the origin of the breadcrumb. This is typically used to identify the
122+
/// source of the breadcrumb. For example hybrid SDKs can identify native breadcrumbs from
123+
/// JS or Flutter.
124+
#[metastructure(skip_serialization = "empty")]
125+
pub origin: Annotated<String>,
126+
119127
/// Additional arbitrary fields for forwards compatibility.
120128
#[metastructure(additional_properties)]
121129
pub other: Object<Value>,
@@ -140,6 +148,7 @@ mod tests {
140148
"a": "b"
141149
},
142150
"event_id": "52df9022835246eeb317dbd739ccd059",
151+
"origin": "myorigin",
143152
"c": "d"
144153
}"#;
145154

@@ -153,6 +162,7 @@ mod tests {
153162
"a": "b"
154163
},
155164
"event_id": "52df9022835246eeb317dbd739ccd059",
165+
"origin": "myorigin",
156166
"c": "d"
157167
}"#;
158168

@@ -179,6 +189,7 @@ mod tests {
179189
);
180190
map
181191
},
192+
origin: Annotated::new("myorigin".to_string()),
182193
});
183194

184195
assert_eq!(breadcrumb, Annotated::from_json(input).unwrap());

0 commit comments

Comments
 (0)