Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- Emit outcomes for spans trimmed from a transaction. ([#5410](https://github.com/getsentry/relay/pull/5410))
- Support `sample` alias in CSP reports. ([#5554](https://github.com/getsentry/relay/pull/5554))
- Fix inconsistencies with Insights' expected attributes. ([#5561](https://github.com/getsentry/relay/pull/5561))
- Validate that EAP integer attributes fit into `i64`. ([#5621](https://github.com/getsentry/relay/pull/5621))

**Features**:

Expand Down
19 changes: 18 additions & 1 deletion relay-event-normalization/src/eap/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ pub fn normalize_attribute_types(attributes: &mut Annotated<Attributes>) {
match (&mut inner.value.ty, &mut inner.value.value) {
(Annotated(Some(Boolean), _), Annotated(Some(Value::Bool(_)), _)) => (),
(Annotated(Some(Integer), _), Annotated(Some(Value::I64(_)), _)) => (),
(Annotated(Some(Integer), _), Annotated(Some(Value::U64(_)), _)) => (),
(Annotated(Some(Integer), _), Annotated(Some(Value::U64(u)), _))
if i64::try_from(*u).is_ok() => {}
(Annotated(Some(Double), _), Annotated(Some(Value::I64(_)), _)) => (),
(Annotated(Some(Double), _), Annotated(Some(Value::U64(_)), _)) => (),
(Annotated(Some(Double), _), Annotated(Some(Value::F64(_)), _)) => (),
Expand Down Expand Up @@ -766,6 +767,10 @@ mod tests {
"type": "integer",
"value": "abc"
},
"invalid_int": {
"type": "integer",
"value": 9223372036854775808
},
"missing_type": {
"value": "value with missing type"
},
Expand Down Expand Up @@ -807,6 +812,7 @@ mod tests {
"type": "double",
"value": -42
},
"invalid_int": null,
"invalid_int_from_invalid_string": null,
"missing_type": null,
"missing_value": null,
Expand Down Expand Up @@ -867,6 +873,17 @@ mod tests {
"some_other_field": "some_other_value"
},
"_meta": {
"invalid_int": {
"": {
"err": [
"invalid_data"
],
"val": {
"type": "integer",
"value": 9223372036854775808
}
}
},
"invalid_int_from_invalid_string": {
"": {
"err": [
Expand Down
12 changes: 11 additions & 1 deletion tests/integration/test_spansv2.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ def test_spansv2_basic(
"attributes": {
"foo": {"value": "bar", "type": "string"},
"array": {"value": ["foo", "bar"], "type": "array"},
"valid_int": {"value": 9223372036854775807, "type": "integer"},
"invalid_int": {"value": 9223372036854775808, "type": "integer"},
"invalid": {"value": True, "type": "string"},
"http.response_content_length": {"value": 17, "type": "integer"},
},
Expand All @@ -96,6 +98,8 @@ def test_spansv2_basic(
"foo": {"type": "string", "value": "bar"},
"http.response_content_length": {"value": 17, "type": "integer"},
"http.response.body.size": {"value": 17, "type": "integer"},
"valid_int": {"value": 9223372036854775807, "type": "integer"},
"invalid_int": None,
"invalid": None,
"sentry.browser.name": {"type": "string", "value": "Python Requests"},
"sentry.browser.version": {"type": "string", "value": "2.32"},
Expand All @@ -118,12 +122,18 @@ def test_spansv2_basic(
},
"_meta": {
"attributes": {
"invalid_int": {
"": {
"err": ["invalid_data"],
"val": {"type": "integer", "value": 9223372036854775808},
}
},
"invalid": {
"": {
"err": ["invalid_data"],
"val": {"type": "string", "value": True},
}
}
},
}
},
"name": "some op",
Expand Down
Loading