You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(feedback): document new feedback envelope format and rename old format (#12252)
* Revert "Revert "feat(feedback): document new feedback envelope format and ren…"
This reverts commit 19eb587.
* Add note on user context and anonymous feedbacks
* User report wording and titel update
* user report json update
Co-authored-by: Bruno Garcia <[email protected]>
---------
Co-authored-by: Bruno Garcia <[email protected]>
Copy file name to clipboardExpand all lines: develop-docs/application-architecture/feedback-architecture.mdx
+8-10Lines changed: 8 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,17 +11,17 @@ It will:
11
11
12
12
## Creation sources
13
13
14
-
When broken down, there are **5** ways to create feedback in our system 😵💫.
15
-
(But 4 of them, related to user reports, are quite similar!) A good reference is the
14
+
When broken down, there are **4** ways to create feedback in our system, with
15
+
3 sharing the same data model. A good reference is the
16
16
`FeedbackCreationSource(Enum)` in [create_feedback.py](https://github.com/getsentry/sentry/blob/2b642e149c79b251e1c2f4339fc73d656347d74e/src/sentry/feedback/usecases/create_feedback.py#L33-L33).
17
17
The 4 ways _clients_ can create feedback are:
18
18
19
-
`NEW_FEEDBACK_ENVELOPE`: [The new format](https://develop.sentry.dev/sdk/data-model/envelopes/#full-examples) created by the Replay team when adding
19
+
`NEW_FEEDBACK_ENVELOPE`: [The new format](/sdk/data-model/envelope-items/#user-feedback) created by the Replay team when adding
20
20
the [User Feedback Widget](https://docs.sentry.io/product/user-feedback/#user-feedback-widget)
21
21
to the JavaScript SDK. It allows adding more information, for example tags,
22
22
release, url, etc.
23
23
24
-
`USER_REPORT_ENVELOPE`: [The older format](https://develop.sentry.dev/sdk/data-model/envelope-items/#user-feedback) with name/email/comments, that requires
24
+
`USER_REPORT_ENVELOPE`: [The older format](/sdk/data-model/envelope-items/#user-report) with name/email/comments, that requires
25
25
`event_id` to link a Sentry error event.
26
26
27
27
`USER_REPORT_DJANGO_ENDPOINT`: [The deprecated Web API](https://docs.sentry.io/api/projects/submit-user-feedback/)
@@ -31,7 +31,7 @@ release, url, etc.
31
31
## How feedback is stored
32
32
33
33
On the backend, each feedback submission in Sentry's UI is **an un-grouped issue occurrence**,
34
-
saved via the [issues platform](https://develop.sentry.dev/issue-platform/).
34
+
saved via the [issues platform](/issue-platform/).
35
35
The entrypoint is [**`create_feedback_issue()`**](https://github.com/getsentry/sentry/blob/2b642e149c79b251e1c2f4339fc73d656347d74e/src/sentry/feedback/usecases/create_feedback.py#L184-L184),
36
36
which
37
37
@@ -42,7 +42,7 @@ which
42
42
43
43
## Feedback events
44
44
45
-
The new and preferred way to send feedback from the SDK is in an [event envelope](https://develop.sentry.dev/sdk/data-model/envelopes/#full-examples).
45
+
The preferred way of sending feedback from the SDK is in [feedback envelope](/sdk/data-model/envelope-items/#user-feedback).
46
46
The format is the same as error events, except the `type` header = `"feedback"`. While
47
47
user reports have an associated event, **new feedback _is_ an event**. This
48
48
offers 2 improvements:
@@ -94,7 +94,7 @@ In Relay v24.5.1, we migrated feedback to its own kafka topic + consumer,
94
94
### Attachments
95
95
96
96
We only use attachments for the widget’s screenshot feature, which allows users
97
-
to submit **at most 1 screenshot per feedback**. Attachments are another [item type](https://develop.sentry.dev/sdk/data-model/envelopes/#attachment)
97
+
to submit **at most 1 screenshot per feedback**. Attachments are another [item type](/sdk/data-model/envelopes/#attachment)
98
98
in an envelope.
99
99
100
100
- SDK v8.0.0+, Relay v24.5.1+: Sends the feedback and attachment items in the same envelope.
@@ -186,9 +186,7 @@ graph TD
186
186
187
187
### Envelopes
188
188
189
-
User reports are also sent to Relay in [envelope format](https://develop.sentry.dev/sdk/data-model/envelope-items/#user-feedback).
190
-
**This item type is misleadingly called “user feedback” in some of our docs, but the
191
-
item header will read `"user_report"`.**
189
+
User reports are also sent to Relay in envelope format, item type [user_report](/sdk/data-model/envelope-items/#user-report).
192
190
193
191
The SDK function that sends these is `captureUserFeedback`.
Copy file name to clipboardExpand all lines: develop-docs/sdk/data-model/envelope-items.mdx
+99-10Lines changed: 99 additions & 10 deletions
Display the source diff
Display the rich diff
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**.
16
16
17
17
### Event
18
18
19
-
Item type `"event"`. This Item contains an error or default event payload
19
+
Item type `"event"`. This Item contains an error or default [event payload](/sdk/data-model/event-payloads/)
20
20
encoded in JSON.
21
21
22
22
**Constraints:**
@@ -181,18 +181,101 @@ details.
181
181
182
182
### User Feedback
183
183
184
-
User Feedback was called User Report in the beginning. Therefore the envelope item type is `"user_report"`.
185
-
The item contains a user feedback / user report JSON payload:
184
+
Item type `"feedback"`. This Item contains an [event payload](/sdk/data-model/event-payloads/) encoded in JSON, with an additional `feedback` context object.
We only document attributes for the `contexts.feedback` object, which is **required**
209
+
for this item type. For other attributes, see [Event Payloads](/sdk/data-model/event-payloads/).
210
+
211
+
`message`
212
+
213
+
: **String, required.** Comments of the user, describing what happened and/or sharing
214
+
feedback. The max length is **4096 characters**.
215
+
216
+
`contact_email`
217
+
218
+
: *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.
219
+
220
+
`name`
221
+
222
+
: *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.
223
+
224
+
`url`
225
+
226
+
: *String, optional.* The URL of the webpage the user was on when submitting feedback.
227
+
This may be used to search for or set alerts on feedback.
228
+
229
+
`associated_event_id`
230
+
231
+
: *UUID String, optional.* The identifier of an error event in the same project.
232
+
Use this to explicitly link a related error in the feedback UI.
233
+
234
+
`replay_id`
235
+
236
+
: *UUID String, optional.* The identifier of a related Session Replay in the same
237
+
project. Sentry uses this ID to render a Replay clip in the feedback UI.
238
+
239
+
**Attaching Screenshots:**
240
+
241
+
You can associate screenshots with a feedback by sending image data as
242
+
[attachment items](/sdk/data-model/envelope-items/#attachment), with `event_id`
243
+
corresponding to the feedback item. We recommend sending the items in the same
244
+
Envelope.
245
+
246
+
**Constraints:**
247
+
248
+
- This Item may occur at most once per Envelope.
249
+
- This Item is mutually exclusive with `"transaction"` items.
250
+
251
+
**Required Envelope Headers:**
191
252
192
253
`event_id`
193
254
194
-
: **UUID String, required.** The identifier of the event or transaction.
255
+
: **UUID String, required.** Corresponds to the `event_id` field of the event
256
+
payload. **It is not equal to the `associated_event_id`** field in the feedback
257
+
context. Clients are required to generate an event identifier ahead of time
258
+
and set it at least in the Envelope headers. If the identifier mismatches
259
+
between the Envelope and payload, the Envelope header takes precedence.
260
+
261
+
### User Report - Deprecated
195
262
263
+
Item type `"user_report"`. This is an older way of submitting user feedback we
264
+
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.
265
+
266
+
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.
Copy file name to clipboardExpand all lines: develop-docs/sdk/expected-features/index.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -147,7 +147,7 @@ Ability to get the ID of the last event sent. Event IDs are useful for correlati
147
147
148
148
## User Feedback
149
149
150
-
For all SDKs, it is strongly recommended to send the `User Feedback` as an [envelope item](/sdk/data-model/envelope-items/#user-feedback). Alternatively, the SDKs can
150
+
For all SDKs, it is strongly recommended to send the `User Feedback` as an [envelope item](/sdk/data-model/envelope-items/#user-report). Alternatively, the SDKs can
151
151
use the [User Feedback endpoint](https://docs.sentry.io/api/projects/submit-user-feedback/), which is not recommended.
0 commit comments