From 317af3006b1f8d8f1ef369f34eaf8a551282bd0b Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Mon, 30 Jun 2025 22:51:41 +0200 Subject: [PATCH 1/6] Godot: Add attachment handling documentation --- .../enriching-events/attachments/index.mdx | 92 +++++++++++++++++++ .../attachment-init-with-bytes/godot.mdx | 5 + .../attachment-init-with-path/godot.mdx | 4 + .../attachment-max-size/godot.mdx | 7 ++ .../attachment-upload/godot.mdx | 6 ++ 5 files changed, 114 insertions(+) create mode 100644 docs/platforms/godot/enriching-events/attachments/index.mdx create mode 100644 platform-includes/enriching-events/attachment-init-with-bytes/godot.mdx create mode 100644 platform-includes/enriching-events/attachment-init-with-path/godot.mdx create mode 100644 platform-includes/enriching-events/attachment-max-size/godot.mdx create mode 100644 platform-includes/enriching-events/attachment-upload/godot.mdx diff --git a/docs/platforms/godot/enriching-events/attachments/index.mdx b/docs/platforms/godot/enriching-events/attachments/index.mdx new file mode 100644 index 00000000000000..cde24a44694a6d --- /dev/null +++ b/docs/platforms/godot/enriching-events/attachments/index.mdx @@ -0,0 +1,92 @@ +--- +title: Attachments +description: "Learn more about how Sentry can store additional files in the same request as event attachments." +--- + +Sentry can enrich your events for further investigation by storing additional files, such as config or log files, as attachments. + +## Creating Attachments + +The simplest way to create an attachment is to use a `path`. The SDK will read the contents of the file each time it prepares an event or transaction, then adds the attachment to the same [envelope](https://develop.sentry.dev/sdk/data-model/envelopes/). If the SDK can't read the file, the SDK logs an error message and drops the attachment. + + + +Alternately, use `bytes` to initialize an attachment. When doing so, you also need to specify a filename. + + + +If your SDK supports offline caching, which is typical for mobile, each attachment is stored to disk for each event or transaction you capture when the device is offline. When using large attachments, this storage can consume the disk space if the device is offline for a longer time period. You can specify [maximum attachment size](#maximum-attachment-size) to drop large attachments and avoid this issue. + +In addition, you can set these parameters: + +`filename` + +The filename is the name of the file to display in Sentry. When using bytes you have to specify a filename, whereas with a path you don't as the SDK is going to use the last path component. + +`content_type` + +The specific media content type that determines how the attachment is rendered in the Sentry UI. Any [MIME type](https://www.iana.org/assignments/media-types/media-types.xhtml) may be used; the default is `application/octet-stream`. + + We currently support and can render the following MIME types: + +- `text/plain` +- `text/css` +- `text/csv` +- `text/html` +- `text/javascript` +- `text/json` or `text/x-json` or `application/json` or `application/ld+json` +- `image/jpeg` +- `image/png` +- `image/gif` + +## Uploading Attachments + +You can add attachments that will be sent with every event using `SentrySDK.add_attachment()` method. + + + + + +Sentry allows at most 20MB for a compressed request, and at most 100MB of uncompressed attachments per event, including the crash report file (if applicable). Uploads exceeding this size are rejected with HTTP error `413 Payload Too Large` and the data is dropped immediately. To add larger or more files, consider secondary storage options. + + + +Attachments persist for 30 days; if your total storage included in your quota is exceeded, attachments will not be stored. You can delete attachments or their containing events at any time. Deleting an attachment does not affect your quota - Sentry counts an attachment toward your quota as soon as it is stored. + +Learn more about how attachments impact your [quota](/pricing/quotas/). + +### Access to Attachments + +To limit access to attachments, navigate to your organization's **General Settings**, then select the _Attachments Access_ dropdown to set appropriate access — any member of your organization, the organization billing owner, member, admin, manager, or owner. + + + +By default, access is granted to all members when storage is enabled. If a member does not have access to the project, the ability to download an attachment is not available; the button will be greyed out in Sentry. The member may only view that an attachment is stored. + +## Store Minidumps as Attachments + + + +☝ This feature is supported on Windows, Linux, and Android. + + + +## Viewing Attachments + +Attachments display on the bottom of the **Issue Details** page for the event that is shown. + + + +Alternately, attachments also appear in the _Attachments_ tab on the **Issue Details** page, where you can view the _Type_ of attachment, as well as associated events. Click the Event ID to open the **Issue Details** of that specific event. + + + +## Maximum Attachment Size + +The maximum size for each attachment is set on `SentryOptions.max_attachment_size`. + +The scale is bytes and the default is `20 MiB`. Please also check the +[maximum attachment size of Relay](/product/relay/options/) +to make sure your attachments don't get discarded there. + + diff --git a/platform-includes/enriching-events/attachment-init-with-bytes/godot.mdx b/platform-includes/enriching-events/attachment-init-with-bytes/godot.mdx new file mode 100644 index 00000000000000..da1dfdda81000d --- /dev/null +++ b/platform-includes/enriching-events/attachment-init-with-bytes/godot.mdx @@ -0,0 +1,5 @@ +```GDScript +var bytes: PackedByteArray = "Hello, world!".to_ascii_buffer() +var attachment := SentryAttachment.create_with_bytes(bytes, "hello.txt") +attachment.content_type = "text/plain" +``` diff --git a/platform-includes/enriching-events/attachment-init-with-path/godot.mdx b/platform-includes/enriching-events/attachment-init-with-path/godot.mdx new file mode 100644 index 00000000000000..c56c37f3c2de5c --- /dev/null +++ b/platform-includes/enriching-events/attachment-init-with-path/godot.mdx @@ -0,0 +1,4 @@ +```GDScript +var attachment := SentryAttachment.create_with_path("user://logs/godot.log") +attachment.content_type = "text/plain" +``` diff --git a/platform-includes/enriching-events/attachment-max-size/godot.mdx b/platform-includes/enriching-events/attachment-max-size/godot.mdx new file mode 100644 index 00000000000000..90ba3e67882f74 --- /dev/null +++ b/platform-includes/enriching-events/attachment-max-size/godot.mdx @@ -0,0 +1,7 @@ +```GDScript +extends SentryConfiguration +## Tip: Assign configuration script in the Project Settings. + +func _configure(options: SentryOptions): + options.max_attachment_size = 5 * 1024 * 1024 # 5 MiB +``` diff --git a/platform-includes/enriching-events/attachment-upload/godot.mdx b/platform-includes/enriching-events/attachment-upload/godot.mdx new file mode 100644 index 00000000000000..9c2228e0be2795 --- /dev/null +++ b/platform-includes/enriching-events/attachment-upload/godot.mdx @@ -0,0 +1,6 @@ +```GDScript +# Global scope +var attachment := SentryAttachment.create_with_path("user://logs/godot.log") +attachment.content_type = "text/plain" +SentrySDK.add_attachment(attachment) +``` From e86fabedcd523f05485cde3a014b2972c7fffa72 Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Mon, 30 Jun 2025 23:19:35 +0200 Subject: [PATCH 2/6] Use platform identifiers --- docs/platforms/godot/enriching-events/attachments/index.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/platforms/godot/enriching-events/attachments/index.mdx b/docs/platforms/godot/enriching-events/attachments/index.mdx index cde24a44694a6d..9c8dbf3d594afe 100644 --- a/docs/platforms/godot/enriching-events/attachments/index.mdx +++ b/docs/platforms/godot/enriching-events/attachments/index.mdx @@ -41,7 +41,7 @@ The specific media content type that determines how the attachment is rendered i ## Uploading Attachments -You can add attachments that will be sent with every event using `SentrySDK.add_attachment()` method. +You can add attachments that will be sent with every event using method. @@ -83,7 +83,7 @@ Alternately, attachments also appear in the _Attachments_ tab on the **Issue Det ## Maximum Attachment Size -The maximum size for each attachment is set on `SentryOptions.max_attachment_size`. +The maximum size for each attachment is set on . The scale is bytes and the default is `20 MiB`. Please also check the [maximum attachment size of Relay](/product/relay/options/) From 82b5cecdb96dbb479a82d19d772125f44505e73f Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Tue, 1 Jul 2025 15:04:16 +0200 Subject: [PATCH 3/6] Document max-attachment-size option --- docs/platforms/godot/configuration/options.mdx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/platforms/godot/configuration/options.mdx b/docs/platforms/godot/configuration/options.mdx index 337b06942249ca..ca10cc4eaf2063 100644 --- a/docs/platforms/godot/configuration/options.mdx +++ b/docs/platforms/godot/configuration/options.mdx @@ -108,6 +108,16 @@ If enabled, the SDK will capture and attach scene tree information to events. Th + + +Defines the maximum size of each attachment in bytes that can be sent with an event. If an attachment exceeds this size, it will be dropped. The default is 20MiB. Please also check the [maximum attachment size of Relay](/product/relay/options/) to make sure your attachments don't get discarded there. + + +This option is currently only effective on Android. + + + + ## Error Logger Options From 4445a223d087f66a53360280bd9ea59844c9e7a5 Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Wed, 2 Jul 2025 15:56:25 +0200 Subject: [PATCH 4/6] Drop max attachment size options --- .../godot/enriching-events/attachments/index.mdx | 12 +----------- .../enriching-events/attachment-max-size/godot.mdx | 7 ------- 2 files changed, 1 insertion(+), 18 deletions(-) delete mode 100644 platform-includes/enriching-events/attachment-max-size/godot.mdx diff --git a/docs/platforms/godot/enriching-events/attachments/index.mdx b/docs/platforms/godot/enriching-events/attachments/index.mdx index 9c8dbf3d594afe..34b5cba1665313 100644 --- a/docs/platforms/godot/enriching-events/attachments/index.mdx +++ b/docs/platforms/godot/enriching-events/attachments/index.mdx @@ -15,7 +15,7 @@ Alternately, use `bytes` to initialize an attachment. When doing so, you also ne -If your SDK supports offline caching, which is typical for mobile, each attachment is stored to disk for each event or transaction you capture when the device is offline. When using large attachments, this storage can consume the disk space if the device is offline for a longer time period. You can specify [maximum attachment size](#maximum-attachment-size) to drop large attachments and avoid this issue. +If your SDK supports offline caching, which is typical for mobile, each attachment is stored to disk for each event or transaction you capture when the device is offline. When using large attachments, this storage can consume the disk space if the device is offline for a longer time period. In addition, you can set these parameters: @@ -80,13 +80,3 @@ Attachments display on the bottom of the **Issue Details** page for the event th Alternately, attachments also appear in the _Attachments_ tab on the **Issue Details** page, where you can view the _Type_ of attachment, as well as associated events. Click the Event ID to open the **Issue Details** of that specific event. - -## Maximum Attachment Size - -The maximum size for each attachment is set on . - -The scale is bytes and the default is `20 MiB`. Please also check the -[maximum attachment size of Relay](/product/relay/options/) -to make sure your attachments don't get discarded there. - - diff --git a/platform-includes/enriching-events/attachment-max-size/godot.mdx b/platform-includes/enriching-events/attachment-max-size/godot.mdx deleted file mode 100644 index 90ba3e67882f74..00000000000000 --- a/platform-includes/enriching-events/attachment-max-size/godot.mdx +++ /dev/null @@ -1,7 +0,0 @@ -```GDScript -extends SentryConfiguration -## Tip: Assign configuration script in the Project Settings. - -func _configure(options: SentryOptions): - options.max_attachment_size = 5 * 1024 * 1024 # 5 MiB -``` From 5939e5a91ff0af0044f0d6ac3d66386c9f779275 Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Wed, 2 Jul 2025 15:59:54 +0200 Subject: [PATCH 5/6] Promote to note the paragraph about disk space impact of offline attachments --- docs/platforms/godot/enriching-events/attachments/index.mdx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/platforms/godot/enriching-events/attachments/index.mdx b/docs/platforms/godot/enriching-events/attachments/index.mdx index 34b5cba1665313..db3ecb26f303ed 100644 --- a/docs/platforms/godot/enriching-events/attachments/index.mdx +++ b/docs/platforms/godot/enriching-events/attachments/index.mdx @@ -15,8 +15,12 @@ Alternately, use `bytes` to initialize an attachment. When doing so, you also ne + + If your SDK supports offline caching, which is typical for mobile, each attachment is stored to disk for each event or transaction you capture when the device is offline. When using large attachments, this storage can consume the disk space if the device is offline for a longer time period. + + In addition, you can set these parameters: `filename` From eb8f3ee276149966e13221eeccfce59a88079ab6 Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Wed, 2 Jul 2025 16:01:03 +0200 Subject: [PATCH 6/6] Remove max-attachment-size config docs --- docs/platforms/godot/configuration/options.mdx | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/docs/platforms/godot/configuration/options.mdx b/docs/platforms/godot/configuration/options.mdx index ca10cc4eaf2063..337b06942249ca 100644 --- a/docs/platforms/godot/configuration/options.mdx +++ b/docs/platforms/godot/configuration/options.mdx @@ -108,16 +108,6 @@ If enabled, the SDK will capture and attach scene tree information to events. Th - - -Defines the maximum size of each attachment in bytes that can be sent with an event. If an attachment exceeds this size, it will be dropped. The default is 20MiB. Please also check the [maximum attachment size of Relay](/product/relay/options/) to make sure your attachments don't get discarded there. - - -This option is currently only effective on Android. - - - - ## Error Logger Options