-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat(feedback): document new feedback envelope format and rename old format #12252
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
Merged
aliu39
merged 4 commits into
master
from
revert-12251-revert-12188-aliu/feedback-envelope
Jan 8, 2025
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ The headers described in this section are **in addition to the common headers**. | |
|
||
### Event | ||
|
||
Item type `"event"`. This Item contains an error or default event payload | ||
Item type `"event"`. This Item contains an error or default [event payload](/sdk/data-model/event-payloads/) | ||
encoded in JSON. | ||
|
||
**Constraints:** | ||
|
@@ -181,18 +181,101 @@ details. | |
|
||
### User Feedback | ||
|
||
User Feedback was called User Report in the beginning. Therefore the envelope item type is `"user_report"`. | ||
The item contains a user feedback / user report JSON payload: | ||
Item type `"feedback"`. This Item contains an [event payload](/sdk/data-model/event-payloads/) encoded in JSON, with an additional `feedback` context object. | ||
|
||
Example payload: | ||
```json | ||
{"event_id":"9ec79c33ec9942ab8353589fcb2e04dc","email":"[email protected]","name":"John Me","comments":"It broke."}\n | ||
{ | ||
"event_id": "9ec79c33ec9942ab8353589fcb2e04dc", | ||
"timestamp": "2011-05-02T17:41:36Z", | ||
"platform": "javascript", | ||
"level": "error", | ||
"contexts": { | ||
"feedback": { | ||
"contact_email": "[email protected]", | ||
"name": "John Smith", | ||
"message": "I love session replay!", | ||
"url": "https://sentry.io/replays/", | ||
"associated_event_id": "32fd1995636d446385016e2747623e11", | ||
"replay_id":"82840977e85b4ed3bc27f7b5b25cec15" | ||
} | ||
} | ||
} | ||
``` | ||
|
||
**Attributes** | ||
**Payload Attributes** | ||
|
||
We only document attributes for the `contexts.feedback` object, which is **required** | ||
for this item type. For other attributes, see [Event Payloads](/sdk/data-model/event-payloads/). | ||
|
||
`message` | ||
|
||
: **String, required.** Comments of the user, describing what happened and/or sharing | ||
feedback. The max length is **4096 characters**. | ||
|
||
`contact_email` | ||
|
||
: *String, optional.* The email of the user who submitted the feedback. If excluded, Sentry attempts to fill this in with user context. Anonymous feedbacks (no name or email) are still accepted. | ||
|
||
`name` | ||
|
||
: *String, optional.* The name of the user who submitted the feedback. If excluded, Sentry attempts to fill this in with user context. Anonymous feedbacks (no name or email) are still accepted. | ||
|
||
`url` | ||
|
||
: *String, optional.* The URL of the webpage the user was on when submitting feedback. | ||
This may be used to search for or set alerts on feedback. | ||
|
||
`associated_event_id` | ||
|
||
: *UUID String, optional.* The identifier of an error event in the same project. | ||
Use this to explicitly link a related error in the feedback UI. | ||
|
||
`replay_id` | ||
|
||
: *UUID String, optional.* The identifier of a related Session Replay in the same | ||
project. Sentry uses this ID to render a Replay clip in the feedback UI. | ||
|
||
**Attaching Screenshots:** | ||
|
||
You can associate screenshots with a feedback by sending image data as | ||
[attachment items](/sdk/data-model/envelope-items/#attachment), with `event_id` | ||
corresponding to the feedback item. We recommend sending the items in the same | ||
Envelope. | ||
|
||
**Constraints:** | ||
|
||
- This Item may occur at most once per Envelope. | ||
- This Item is mutually exclusive with `"transaction"` items. | ||
|
||
**Required Envelope Headers:** | ||
|
||
`event_id` | ||
|
||
: **UUID String, required.** The identifier of the event or transaction. | ||
: **UUID String, required.** Corresponds to the `event_id` field of the event | ||
payload. **It is not equal to the `associated_event_id`** field in the feedback | ||
context. Clients are required to generate an event identifier ahead of time | ||
and set it at least in the Envelope headers. If the identifier mismatches | ||
between the Envelope and payload, the Envelope header takes precedence. | ||
|
||
### User Report - Deprecated | ||
|
||
Item type `"user_report"`. This is an older way of submitting user feedback we | ||
are have now deprecated. It continues to work so older SDKs won't break. But new implementation should follow the `feedback` item type described above. | ||
|
||
This item works by associating user information and comments with an event. If both the item and its associated event are accepted, we convert it to a user feedback. | ||
|
||
The item contains a JSON payload like this: | ||
```json | ||
{"event_id":"9ec79c33ec9942ab8353589fcb2e04dc","email":"[email protected]","name":"John Me","comments":"It broke."}\n | ||
aliu39 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
``` | ||
|
||
**Payload Attributes** | ||
|
||
`event_id` | ||
|
||
: **UUID String, required.** The identifier of the associated event, ideally | ||
an error. | ||
|
||
`email` | ||
|
||
|
@@ -204,19 +287,25 @@ The item contains a user feedback / user report JSON payload: | |
|
||
`comments` | ||
|
||
: *String, recommended.* Comments of the user about what happened. | ||
: *String, recommended.* Comments of the user about what happened. The max length is **4096 characters**. | ||
|
||
**Constraints:** | ||
|
||
- This Item may occur once per Envelope. | ||
- User Feedbacks / Reports can be ingested separately from their events. We recommended to | ||
send them in the same Envelope. | ||
- User Reports can be ingested separately from their events. However, we recommend | ||
sending them in the same Envelope. | ||
- You may not associate multiple User Reports to the same event. | ||
- The event can not be more than 30 minutes old. | ||
- If the event does not exist in the same project or was never ingested, the report | ||
is discarded and never converted to feedback. | ||
|
||
**Envelope Headers:** | ||
|
||
`event_id` | ||
|
||
: **UUID String, required.** The identifier of the event or transaction. | ||
: **UUID String, required.** Corresponds to the `event_id` field of the payload. | ||
If the identifier mismatches between the Envelope and payload, the Envelope | ||
header takes precedence. | ||
|
||
**Additional Item Headers:** | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.