Skip to content
43 changes: 16 additions & 27 deletions develop-docs/sdk/telemetry/feedbacks.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,40 +16,29 @@ Item type `"feedback"`. This Item contains an [event payload](/sdk/data-model/ev
| Key | Type | Description |
| ---------------------- | ------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| message | string | Required. Comments of the user, describing what happened and/or sharing feedback. The max length is **4096 characters**. |
| contact_email | string | 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 | 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. |
| contact_email | string | The email of the user who submitted the feedback. If excluded, Sentry (not the SDK) attempts to fill this in with user context. Anonymous feedbacks (no name or email) are still accepted. |
| name | string | The name of the user who submitted the feedback. If excluded, Sentry (not the SDK) attempts to fill this in with user context. Anonymous feedbacks (no name or email) are still accepted. |
| url | string | 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 | string | The identifier of an error event in the same project. Use this to explicitly link a related error in the feedback UI. |
| replay_id | string | The identifier of a related Session Replay in the same project. Sentry uses this ID to render a Replay clip in the feedback UI. |

### Event Event Attributes
### Event Attributes

Below is a recap of the [required attributes](/sdk/data-model/event-payloads/#required-attributes) for the event payload.
For the full list of attributes, see [Event Payloads](/sdk/data-model/event-payloads/).

| Key | Type | Description |
| -------------------------- | ------ | ------------------------------------------------ |
| timestamp | number | UNIX timestamp of the current time (in seconds). |
| event_id | string | This should be the same as `replay_id` |
| dist | string | - |
| platform | string | - |
| environment | string | - |
| release | string | - |
| user.id | string | - |
| user.username | string | - |
| user.email | string | - |
| user.ip_address | string | - |
| sdk.name | string | - |
| sdk.version | string | - |
| request.url | string | - |
| request.headers.User-Agent | string | - |
| Key | Type | Description |
| -------------------------- | ------ | ----------------------------------------------- |
| timestamp | number | UNIX timestamp of the current time (in seconds) |
| event_id | string | Hexadecimal string representing a uuid4 value |
| platform | string | |

### Example
```json
{
"event_id": "9ec79c33ec9942ab8353589fcb2e04dc",
"timestamp": "2011-05-02T17:41:36Z",
"platform": "javascript",
"level": "error",
"contexts": {
"feedback": {
"contact_email": "[email protected]",
Expand Down Expand Up @@ -79,7 +68,6 @@ Envelope.
"event_id": "9ec79c33ec9942ab8353589fcb2e04dc",
"timestamp": "2011-05-02T17:41:36Z",
"platform": "javascript",
"level": "error",
"contexts": {
"organization": { "id": "0", "slug": "sentry" },
"feedback": {
Expand All @@ -91,6 +79,7 @@ Envelope.
"replay_id":"82840977e85b4ed3bc27f7b5b25cec15"
}
},
"level": "error",
"environment": "prod",
"release": "frontend@f00",
"sdk": {
Expand All @@ -108,9 +97,9 @@ Envelope.
},
"user": {
"ip_address": "127.0.0.1",
"email": "[email protected]",
"email": "[email protected]",
"id": 1,
"name": "Admin"
"name": "John Smith"
}
}
```
Expand All @@ -125,16 +114,16 @@ SDKs should implement a `beforeSendFeedback` callback to allow users to modify t

### Scope Data and Event Processors

The scope is applied to the feedbacks, including tags, attachments, and trace context. The scope’s _event processors_ are invoked, too.
The scope is applied to the feedbacks, including tags, user, trace and contexts. The scope’s _event processors_ are invoked, too.

### Rate Limiting

[Rate limiting](/sdk/expected-features/rate-limiting/) is applied to feedbacks in the same way as it is applied to events.

### Dropped feedback reports
### Dropped Feedback Reports

There is no sample rate for feedbacks, as they are always sampled. However, a feedback can be discarded at any of the pipeline stages. The SDK should report dropped feedbacks through [client reports](/sdk/telemetry/client-reports/).
There is no sample rate for feedbacks, as they are always sampled. However, a feedback can be discarded at any of the pipeline stages, for reasons like rate limiting or an invalid message (too large or empty). The SDK should report dropped feedbacks through [client reports](/sdk/telemetry/client-reports/).

### Session Replay Integration

SDKs are expected to flush the current Session Replay, if running. This ensures a meaningful replay recording exists and can be included in the `replay_id` attribute of the feedback context.
When sending feedback, SDKs are expected to flush the current Session Replay, if running. This ensures a meaningful replay recording exists and can be included in the `replay_id` attribute of the feedback context.