From 6eb5e3df9957854d7fa0c9ba9e557364cd4cf621 Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Mon, 8 Mar 2021 18:35:05 +0100 Subject: [PATCH 1/5] fix(stacktrace): Skip more null values --- relay-general/src/protocol/stacktrace.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/relay-general/src/protocol/stacktrace.rs b/relay-general/src/protocol/stacktrace.rs index 6e77958986..c3028bebf3 100644 --- a/relay-general/src/protocol/stacktrace.rs +++ b/relay-general/src/protocol/stacktrace.rs @@ -76,9 +76,11 @@ pub struct Frame { pub abs_path: Annotated, /// Line number within the source file, starting at 1. + #[metastructure(skip_serialization = "empty")] pub lineno: Annotated, /// Column number within the source file, starting at 1. + #[metastructure(skip_serialization = "empty")] pub colno: Annotated, /// Which platform this frame is from. @@ -93,6 +95,7 @@ pub struct Frame { pub pre_context: Annotated>, /// Source code of the current line (`lineno`). + #[metastructure(skip_serialization = "empty")] pub context_line: Annotated, /// Source code of the lines after `lineno`. @@ -104,6 +107,7 @@ pub struct Frame { /// /// Setting this attribute to `false` causes the frame to be hidden/collapsed by default and /// mostly ignored during issue grouping. + #[metastructure(skip_serialization = "empty")] pub in_app: Annotated, /// Mapping of local variables and expression names that were available in this frame. @@ -113,9 +117,11 @@ pub struct Frame { /// Auxiliary information about the frame that is platform specific. #[metastructure(omit_from_schema)] + #[metastructure(skip_serialization = "empty")] pub data: Annotated, /// (C/C++/Native) Start address of the containing code module (image). + #[metastructure(skip_serialization = "empty")] pub image_addr: Annotated, /// (C/C++/Native) An optional instruction address for symbolication. @@ -124,15 +130,18 @@ pub struct Frame { /// If this is set and a known image is defined in the /// [Debug Meta Interface]({%- link _documentation/development/sdk-dev/event-payloads/debugmeta.md -%}), /// then symbolication can take place. + #[metastructure(skip_serialization = "empty")] pub instruction_addr: Annotated, /// Defines the addressing mode for addresses. + #[metastructure(skip_serialization = "empty")] pub addr_mode: Annotated, /// (C/C++/Native) Start address of the frame's function. /// /// We use the instruction address for symbolication, but this can be used to calculate /// an instruction offset automatically. + #[metastructure(skip_serialization = "empty")] pub symbol_addr: Annotated, /// (C/C++/Native) Used for native crashes to indicate how much we can "trust" the instruction_addr From 4bc812fe601289c3c8e5c5227f6f65c34194dc0f Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Wed, 17 Mar 2021 13:20:37 +0100 Subject: [PATCH 2/5] switch from empty to null --- relay-general/src/protocol/stacktrace.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/relay-general/src/protocol/stacktrace.rs b/relay-general/src/protocol/stacktrace.rs index c3028bebf3..35689696b6 100644 --- a/relay-general/src/protocol/stacktrace.rs +++ b/relay-general/src/protocol/stacktrace.rs @@ -76,11 +76,11 @@ pub struct Frame { pub abs_path: Annotated, /// Line number within the source file, starting at 1. - #[metastructure(skip_serialization = "empty")] + #[metastructure(skip_serialization = "null")] pub lineno: Annotated, /// Column number within the source file, starting at 1. - #[metastructure(skip_serialization = "empty")] + #[metastructure(skip_serialization = "null")] pub colno: Annotated, /// Which platform this frame is from. @@ -95,11 +95,11 @@ pub struct Frame { pub pre_context: Annotated>, /// Source code of the current line (`lineno`). - #[metastructure(skip_serialization = "empty")] + #[metastructure(skip_serialization = "null")] pub context_line: Annotated, /// Source code of the lines after `lineno`. - #[metastructure(skip_serialization = "empty")] + #[metastructure(skip_serialization = "null")] pub post_context: Annotated>, /// Override whether this frame should be considered part of application code, or part of @@ -107,7 +107,7 @@ pub struct Frame { /// /// Setting this attribute to `false` causes the frame to be hidden/collapsed by default and /// mostly ignored during issue grouping. - #[metastructure(skip_serialization = "empty")] + #[metastructure(skip_serialization = "null")] pub in_app: Annotated, /// Mapping of local variables and expression names that were available in this frame. From e0d040e6aa7e6a46bdcf070ef5742b9421170d5a Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Wed, 17 Mar 2021 13:25:25 +0100 Subject: [PATCH 3/5] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b280009b4..ff54cde0cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Emit the `quantity` field for outcomes of events. This field describes the total size in bytes for attachments or the event count for all other categories. A separate outcome is emitted for attachments in a rejected envelope, if any, in addition to the event outcome. ([#942](https://github.com/getsentry/relay/pull/942)) - Add experimental metrics ingestion without bucketing or pre-aggregation. ([#948](https://github.com/getsentry/relay/pull/948)) +- Skip serializing some null values in frames interface. ([#944](https://github.com/getsentry/relay/pull/944)) ## 21.3.0 From ed549674481df493b82d010e842dff614715b8bf Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Fri, 19 Mar 2021 10:59:50 +0100 Subject: [PATCH 4/5] move addrs back to null, and move arrays back to empty --- relay-general/src/protocol/stacktrace.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/relay-general/src/protocol/stacktrace.rs b/relay-general/src/protocol/stacktrace.rs index 35689696b6..c2d4869b42 100644 --- a/relay-general/src/protocol/stacktrace.rs +++ b/relay-general/src/protocol/stacktrace.rs @@ -99,7 +99,7 @@ pub struct Frame { pub context_line: Annotated, /// Source code of the lines after `lineno`. - #[metastructure(skip_serialization = "null")] + #[metastructure(skip_serialization = "empty")] pub post_context: Annotated>, /// Override whether this frame should be considered part of application code, or part of @@ -121,7 +121,7 @@ pub struct Frame { pub data: Annotated, /// (C/C++/Native) Start address of the containing code module (image). - #[metastructure(skip_serialization = "empty")] + #[metastructure(skip_serialization = "null")] pub image_addr: Annotated, /// (C/C++/Native) An optional instruction address for symbolication. @@ -130,7 +130,7 @@ pub struct Frame { /// If this is set and a known image is defined in the /// [Debug Meta Interface]({%- link _documentation/development/sdk-dev/event-payloads/debugmeta.md -%}), /// then symbolication can take place. - #[metastructure(skip_serialization = "empty")] + #[metastructure(skip_serialization = "null")] pub instruction_addr: Annotated, /// Defines the addressing mode for addresses. @@ -141,7 +141,7 @@ pub struct Frame { /// /// We use the instruction address for symbolication, but this can be used to calculate /// an instruction offset automatically. - #[metastructure(skip_serialization = "empty")] + #[metastructure(skip_serialization = "null")] pub symbol_addr: Annotated, /// (C/C++/Native) Used for native crashes to indicate how much we can "trust" the instruction_addr From d22072181fba72c36fb49aab99477af7975d6e37 Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Fri, 19 Mar 2021 11:00:18 +0100 Subject: [PATCH 5/5] add to py changelog --- py/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/py/CHANGELOG.md b/py/CHANGELOG.md index 0c57e896cd..2ea891d252 100644 --- a/py/CHANGELOG.md +++ b/py/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## Unreleased + +- Skip serializing some null values in frames interface. ([#944](https://github.com/getsentry/relay/pull/944)) + ## 0.8.4 - Deny backslashes in release names. ([#904](https://github.com/getsentry/relay/pull/904))