Skip to content

Commit 19eb587

Browse files
authored
Revert "feat(feedback): document new feedback envelope format and rename old …" (#12251)
This reverts commit c924f0d.
1 parent 5d69797 commit 19eb587

File tree

3 files changed

+21
-108
lines changed

3 files changed

+21
-108
lines changed

develop-docs/application-architecture/feedback-architecture.mdx

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ It will:
1111

1212
## Creation sources
1313

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
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
1616
`FeedbackCreationSource(Enum)` in [create_feedback.py](https://github.com/getsentry/sentry/blob/2b642e149c79b251e1c2f4339fc73d656347d74e/src/sentry/feedback/usecases/create_feedback.py#L33-L33).
1717
The 4 ways _clients_ can create feedback are:
1818

19-
`NEW_FEEDBACK_ENVELOPE`: [The new format](/sdk/data-model/envelope-items/#user-feedback) created by the Replay team when adding
19+
`NEW_FEEDBACK_ENVELOPE`: [The new format](https://develop.sentry.dev/sdk/data-model/envelopes/#full-examples) created by the Replay team when adding
2020
the [User Feedback Widget](https://docs.sentry.io/product/user-feedback/#user-feedback-widget)
2121
to the JavaScript SDK. It allows adding more information, for example tags,
2222
release, url, etc.
2323

24-
`USER_REPORT_ENVELOPE`: [The older format](/sdk/data-model/envelope-items/#user-report) with name/email/comments, that requires
24+
`USER_REPORT_ENVELOPE`: [The older format](https://develop.sentry.dev/sdk/data-model/envelope-items/#user-feedback) with name/email/comments, that requires
2525
`event_id` to link a Sentry error event.
2626

2727
`USER_REPORT_DJANGO_ENDPOINT`: [The deprecated Web API](https://docs.sentry.io/api/projects/submit-user-feedback/)
@@ -31,7 +31,7 @@ release, url, etc.
3131
## How feedback is stored
3232

3333
On the backend, each feedback submission in Sentry's UI is **an un-grouped issue occurrence**,
34-
saved via the [issues platform](/issue-platform/).
34+
saved via the [issues platform](https://develop.sentry.dev/issue-platform/).
3535
The entrypoint is [**`create_feedback_issue()`**](https://github.com/getsentry/sentry/blob/2b642e149c79b251e1c2f4339fc73d656347d74e/src/sentry/feedback/usecases/create_feedback.py#L184-L184),
3636
which
3737

@@ -42,7 +42,7 @@ which
4242

4343
## Feedback events
4444

45-
The preferred way of sending feedback from the SDK is in [feedback envelope](/sdk/data-model/envelope-items/#user-feedback).
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).
4646
The format is the same as error events, except the `type` header = `"feedback"`. While
4747
user reports have an associated event, **new feedback _is_ an event**. This
4848
offers 2 improvements:
@@ -94,7 +94,7 @@ In Relay v24.5.1, we migrated feedback to its own kafka topic + consumer,
9494
### Attachments
9595

9696
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](/sdk/data-model/envelopes/#attachment)
97+
to submit **at most 1 screenshot per feedback**. Attachments are another [item type](https://develop.sentry.dev/sdk/data-model/envelopes/#attachment)
9898
in an envelope.
9999

100100
- SDK v8.0.0+, Relay v24.5.1+: Sends the feedback and attachment items in the same envelope.
@@ -186,7 +186,9 @@ graph TD
186186

187187
### Envelopes
188188

189-
User reports are also sent to Relay in envelope format, item type [user_report](/sdk/data-model/envelope-items/#user-report).
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"`.**
190192

191193
The SDK function that sends these is `captureUserFeedback`.
192194

develop-docs/sdk/data-model/envelope-items.mdx

Lines changed: 10 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The headers described in this section are **in addition to the common headers**.
1616

1717
### Event
1818

19-
Item type `"event"`. This Item contains an error or default [event payload](/sdk/data-model/event-payloads/)
19+
Item type `"event"`. This Item contains an error or default event payload
2020
encoded in JSON.
2121

2222
**Constraints:**
@@ -181,101 +181,18 @@ details.
181181

182182
### User Feedback
183183

184-
Item type `"feedback"`. This Item contains an [event payload](/sdk/data-model/event-payloads/) encoded in JSON, with an additional `feedback` context object.
185-
186-
Example payload:
187-
```json
188-
{
189-
"event_id": "9ec79c33ec9942ab8353589fcb2e04dc",
190-
"timestamp": "2011-05-02T17:41:36Z",
191-
"platform": "javascript",
192-
"level": "error",
193-
"contexts": {
194-
"feedback": {
195-
"contact_email": "[email protected]",
196-
"name": "John Smith",
197-
"message": "I love session replay!",
198-
"url": "https://sentry.io/replays/",
199-
"associated_event_id": "32fd1995636d446385016e2747623e11",
200-
"replay_id":"82840977e85b4ed3bc27f7b5b25cec15"
201-
}
202-
}
203-
}
204-
```
205-
206-
**Payload Attributes**
207-
208-
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, recommended.* The email of the user who submitted the feedback.
219-
220-
`name`
221-
222-
: *String, optional.* The name of the user who submitted the feedback.
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:**
252-
253-
`event_id`
254-
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
262-
263-
Item type `"user_report"`. This is an older way of submitting user feedback we
264-
are in the process of deprecating. It works by associating user information and
265-
comments with an event. If both the item and its associated event are accepted,
266-
we convert it to a user feedback.
267-
268-
The item contains a JSON payload like this:
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:
269186
```json
270187
{"event_id":"9ec79c33ec9942ab8353589fcb2e04dc","email":"[email protected]","name":"John Me","comments":"It broke."}\n
271188
```
272189

273-
**Payload Attributes**
190+
**Attributes**
274191

275192
`event_id`
276193

277-
: **UUID String, required.** The identifier of the associated event, ideally
278-
an error.
194+
: **UUID String, required.** The identifier of the event or transaction.
195+
279196

280197
`email`
281198

@@ -287,25 +204,19 @@ an error.
287204

288205
`comments`
289206

290-
: *String, recommended.* Comments of the user about what happened. The max length is **4096 characters**.
207+
: *String, recommended.* Comments of the user about what happened.
291208

292209
**Constraints:**
293210

294211
- This Item may occur once per Envelope.
295-
- User Reports can be ingested separately from their events. However, we recommend
296-
sending them in the same Envelope.
297-
- You may not associate multiple User Reports to the same event.
298-
- The event can not be more than 30 minutes old.
299-
- If the event does not exist in the same project or was never ingested, the report
300-
is discarded and never converted to feedback.
212+
- User Feedbacks / Reports can be ingested separately from their events. We recommended to
213+
send them in the same Envelope.
301214

302215
**Envelope Headers:**
303216

304217
`event_id`
305218

306-
: **UUID String, required.** Corresponds to the `event_id` field of the payload.
307-
If the identifier mismatches between the Envelope and payload, the Envelope
308-
header takes precedence.
219+
: **UUID String, required.** The identifier of the event or transaction.
309220

310221
**Additional Item Headers:**
311222

develop-docs/sdk/expected-features/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ Ability to get the ID of the last event sent. Event IDs are useful for correlati
147147

148148
## User Feedback
149149

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
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
151151
use the [User Feedback endpoint](https://docs.sentry.io/api/projects/submit-user-feedback/), which is not recommended.
152152

153153
### User Facing Platforms

0 commit comments

Comments
 (0)