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 0000000000000..db3ecb26f303e --- /dev/null +++ b/docs/platforms/godot/enriching-events/attachments/index.mdx @@ -0,0 +1,86 @@ +--- +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. + + + +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 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. + + 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 0000000000000..da1dfdda81000 --- /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 0000000000000..c56c37f3c2de5 --- /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-upload/godot.mdx b/platform-includes/enriching-events/attachment-upload/godot.mdx new file mode 100644 index 0000000000000..9c2228e0be279 --- /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) +```