From 5d768fe91eaf99c946b3ec262e70a7eb7da994d2 Mon Sep 17 00:00:00 2001 From: Mischan Toosarani-Hausberger Date: Tue, 10 Sep 2024 10:58:35 +0200 Subject: [PATCH 1/4] feat(native): add a compressed minidump endpoint example --- .../native/guides/minidumps/index.mdx | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/docs/platforms/native/guides/minidumps/index.mdx b/docs/platforms/native/guides/minidumps/index.mdx index 8abdbc6d22731..5dbe673eb9662 100644 --- a/docs/platforms/native/guides/minidumps/index.mdx +++ b/docs/platforms/native/guides/minidumps/index.mdx @@ -111,6 +111,59 @@ curl -X POST \ For the full list of supported values, see [_Event Payloads_](https://develop.sentry.dev/sdk/event-payloads/) and linked documents. +## Uploading a Compressed Minidump + +You can compress your minidump using `gzip` if its size exceeds the limits in the next section. + +In this case, you would `POST` the minidump as a gzip-encoded binary: + +```bash +gzip mini.dmp + +curl -X POST \ + '___MINIDUMP_URL___' \ + -H 'content-type:application/x-dmp' \ + -H 'content-encoding: gzip' \ + --data-binary @mini.dmp.gz +``` + +Since `curl` doesn't allow adding multipart form fields to "data" `POST` requests, you cannot easily pass additional data as fields as in the previous section's examples. + +In that case, you must construct the multipart content manually and compress it as a whole: + +```bash +# Use a consistent multipart boundary throughout the example +# and ensure it is a unique string inside the entire multipart body +printf -- '--boundary_minidumpXYZ\r\n' > multipart_body.txt + +# Add additional data via JSON or using the bracket syntax (the latter requiring a field for each entry) +printf -- 'Content-Disposition: form-data; name="sentry"\r\n\r\n' >> multipart_body.txt +printf -- '{"release":"my-project-name@2.3.12","tags":{"mytag":"value"}}\r\n' >> multipart_body.txt + +# Add the boundary before each field (in this case the minidump) +printf -- '--boundary_minidumpXYZ\r\n' >> multipart_body.txt + +# Add the minidump field header +printf -- 'Content-Disposition: form-data; name="upload_file_minidump"; filename="mini.dmp"\r\n' >> multipart_body.txt +printf -- 'Content-Type: application/x-dmp\r\n\r\n' >> multipart_body.txt + +# Append the minidump content +cat mini.dmp >> multipart_body.txt + +# Add the closing boundary +printf -- '\r\n--boundary_minidumpXYZ--\r\n' >> multipart_body.txt + +# Compress the entire multipart body +gzip multipart_body.txt + +# Send the compressed multipart body with curl +curl -X POST \ + '___MINIDUMP_URL___' \ + -H 'Content-Type: multipart/form-data; boundary=boundary_minidumpXYZ' \ + -H 'Content-Encoding: gzip' \ + --data-binary @multipart_body.txt.gz +``` + ## Size Limits Event ingestion imposes limits on the size and number of fields in multipart From a21a78e511a6544fc6e464e2530c9346df867e2c Mon Sep 17 00:00:00 2001 From: Mischan Toosarani-Hausberger Date: Tue, 10 Sep 2024 22:25:20 +0200 Subject: [PATCH 2/4] link the limits section instead of only referring to it Co-authored-by: vivianyentran <20403606+vivianyentran@users.noreply.github.com> --- docs/platforms/native/guides/minidumps/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/native/guides/minidumps/index.mdx b/docs/platforms/native/guides/minidumps/index.mdx index 5dbe673eb9662..803628065d160 100644 --- a/docs/platforms/native/guides/minidumps/index.mdx +++ b/docs/platforms/native/guides/minidumps/index.mdx @@ -113,7 +113,7 @@ documents. ## Uploading a Compressed Minidump -You can compress your minidump using `gzip` if its size exceeds the limits in the next section. +You can compress your minidump using `gzip` if its size exceeds the [limits](#size-limits) in the next section. In this case, you would `POST` the minidump as a gzip-encoded binary: From d040c9a7ee112dca51d00b81d866603f2f39d185 Mon Sep 17 00:00:00 2001 From: Mischan Toosarani-Hausberger Date: Tue, 10 Sep 2024 22:26:34 +0200 Subject: [PATCH 3/4] replace recycled sentence start Co-authored-by: vivianyentran <20403606+vivianyentran@users.noreply.github.com> --- docs/platforms/native/guides/minidumps/index.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/platforms/native/guides/minidumps/index.mdx b/docs/platforms/native/guides/minidumps/index.mdx index 803628065d160..d0cefc83e94a6 100644 --- a/docs/platforms/native/guides/minidumps/index.mdx +++ b/docs/platforms/native/guides/minidumps/index.mdx @@ -127,9 +127,9 @@ curl -X POST \ --data-binary @mini.dmp.gz ``` -Since `curl` doesn't allow adding multipart form fields to "data" `POST` requests, you cannot easily pass additional data as fields as in the previous section's examples. +Since `curl` doesn't allow adding multipart form fields to "data" `POST` requests, you can't easily pass additional data as fields as in the previous section's examples. -In that case, you must construct the multipart content manually and compress it as a whole: +To get around this, you must construct the multipart content manually and compress it as a whole: ```bash # Use a consistent multipart boundary throughout the example From 8bc3b3f82a6b1f6eca3c7ae4213b7fb8a05bb375 Mon Sep 17 00:00:00 2001 From: Mischan Toosarani-Hausberger Date: Wed, 25 Sep 2024 11:01:05 +0200 Subject: [PATCH 4/4] Adapt documentation to compression support in the minidump endpoint of relay --- .../native/guides/minidumps/index.mdx | 53 +------------------ 1 file changed, 1 insertion(+), 52 deletions(-) diff --git a/docs/platforms/native/guides/minidumps/index.mdx b/docs/platforms/native/guides/minidumps/index.mdx index d0cefc83e94a6..183a17abb12eb 100644 --- a/docs/platforms/native/guides/minidumps/index.mdx +++ b/docs/platforms/native/guides/minidumps/index.mdx @@ -111,58 +111,7 @@ curl -X POST \ For the full list of supported values, see [_Event Payloads_](https://develop.sentry.dev/sdk/event-payloads/) and linked documents. -## Uploading a Compressed Minidump - -You can compress your minidump using `gzip` if its size exceeds the [limits](#size-limits) in the next section. - -In this case, you would `POST` the minidump as a gzip-encoded binary: - -```bash -gzip mini.dmp - -curl -X POST \ - '___MINIDUMP_URL___' \ - -H 'content-type:application/x-dmp' \ - -H 'content-encoding: gzip' \ - --data-binary @mini.dmp.gz -``` - -Since `curl` doesn't allow adding multipart form fields to "data" `POST` requests, you can't easily pass additional data as fields as in the previous section's examples. - -To get around this, you must construct the multipart content manually and compress it as a whole: - -```bash -# Use a consistent multipart boundary throughout the example -# and ensure it is a unique string inside the entire multipart body -printf -- '--boundary_minidumpXYZ\r\n' > multipart_body.txt - -# Add additional data via JSON or using the bracket syntax (the latter requiring a field for each entry) -printf -- 'Content-Disposition: form-data; name="sentry"\r\n\r\n' >> multipart_body.txt -printf -- '{"release":"my-project-name@2.3.12","tags":{"mytag":"value"}}\r\n' >> multipart_body.txt - -# Add the boundary before each field (in this case the minidump) -printf -- '--boundary_minidumpXYZ\r\n' >> multipart_body.txt - -# Add the minidump field header -printf -- 'Content-Disposition: form-data; name="upload_file_minidump"; filename="mini.dmp"\r\n' >> multipart_body.txt -printf -- 'Content-Type: application/x-dmp\r\n\r\n' >> multipart_body.txt - -# Append the minidump content -cat mini.dmp >> multipart_body.txt - -# Add the closing boundary -printf -- '\r\n--boundary_minidumpXYZ--\r\n' >> multipart_body.txt - -# Compress the entire multipart body -gzip multipart_body.txt - -# Send the compressed multipart body with curl -curl -X POST \ - '___MINIDUMP_URL___' \ - -H 'Content-Type: multipart/form-data; boundary=boundary_minidumpXYZ' \ - -H 'Content-Encoding: gzip' \ - --data-binary @multipart_body.txt.gz -``` +If your minidump's size exceeds the [limits](#size-limits) in the next section, you can compress it using `gzip`, `zstd`, `bzip2` or `xz` and refer the `upload_file_minidump` to the compressed file instead of the plain minidump. ## Size Limits