-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Godot: Add attachment handling documentation #14210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
317af30
e86fabe
82b5cec
4445a22
5939e5a
eb8f3ee
9aa259f
fbc5271
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. | ||
|
||
<PlatformContent includePath="enriching-events/attachment-init-with-path" /> | ||
|
||
Alternately, use `bytes` to initialize an attachment. When doing so, you also need to specify a filename. | ||
|
||
<PlatformContent includePath="enriching-events/attachment-init-with-bytes" /> | ||
|
||
<Alert title="Note"> | ||
|
||
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. | ||
|
||
</Alert> | ||
|
||
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 <PlatformIdentifier name="SentrySDK.add-attachment()" />. | ||
|
||
<PlatformContent includePath="enriching-events/attachment-upload" /> | ||
|
||
<Alert> | ||
|
||
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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "To add larger or more files, consider secondary storage options." Do we mean that we'll accept this data if integrated with a secondary storage platform? Or just that Sentry does not accept files larger than 20mb/100mb at all? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @bruno-garcia - do you know this answer? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can follow up on this. This block is also present in Unity and Unreal (possibly in other places too), so its scope is larger than this PR’s. |
||
|
||
</Alert> | ||
|
||
Attachments are saved for 30 days. Newly submitted attachments will not be stored if your total storage quota has been exceeded. 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. | ||
|
||
<Include name="common-imgs/attachments-access" /> | ||
|
||
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 | ||
|
||
<Include name="store-minidumps-as-attachments-intro" /> | ||
|
||
<Alert>☝ This feature is supported on Windows, Linux, and Android.</Alert> | ||
|
||
<Include name="store-minidumps-as-attachments-configuration" /> | ||
|
||
## Viewing Attachments | ||
|
||
Attachments display on the bottom of the **Issue Details** page for the event that is shown. | ||
|
||
<Include name="common-imgs/attachments-access-denied" /> | ||
|
||
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. | ||
|
||
<Include name="common-imgs/attachments-list-example" /> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
```GDScript | ||
var attachment := SentryAttachment.create_with_path("user://logs/godot.log") | ||
attachment.content_type = "text/plain" | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
``` |
Uh oh!
There was an error while loading. Please reload this page.