-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add Feedbacks page under Telemetry #13310
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
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a85374c
Added Feedbacks page under Telemetry with SDK processing details
stefanosiano ee6ab8f
Added Feedbacks page under Telemetry with SDK processing details
stefanosiano aebc618
Apply suggestions from code review
stefanosiano c057284
Update develop-docs/sdk/telemetry/feedbacks.mdx
stefanosiano 9808d21
updated user email and name in example envelope
stefanosiano c10743e
Merge remote-tracking branch 'origin/stefanosiano/feedback-telemetry'…
stefanosiano dbf5d99
updated required Event attributes
stefanosiano b4b905d
Update develop-docs/sdk/telemetry/feedbacks.mdx
stefanosiano 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -181,67 +181,9 @@ details. | |
|
|
||
| ### User Feedback | ||
|
|
||
| Item type `"feedback"`. This Item contains an [event payload](/sdk/data-model/event-payloads/) encoded in JSON, with an additional `feedback` context object. | ||
| Item type `"feedback"` contains an event with a feedback context in the payload encoded in JSON. | ||
|
|
||
| Example payload: | ||
| ```json | ||
| { | ||
| "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" | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| **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. | ||
| See the <Link to="/sdk/telemetry/feedbacks/">feedback</Link> documentation for the payload details. | ||
|
|
||
| **Constraints:** | ||
|
|
||
|
|
||
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 |
|---|---|---|
| @@ -0,0 +1,140 @@ | ||
| --- | ||
| title: Feedbacks | ||
| sidebar_order: 4 | ||
| --- | ||
|
|
||
| This document is meant for Sentry SDK developers and maintainers of the Feedback ingestion pipeline. | ||
|
|
||
| ## Feedback Protocol | ||
|
|
||
| Item type `"feedback"`. This Item contains an [event payload](/sdk/data-model/event-payloads/) encoded in JSON, with an additional `feedback` context object. | ||
|
|
||
| ## `"feedback"` Item | ||
|
|
||
| ### Feedback Context Attributes | ||
|
|
||
| | 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. | | ||
| | 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 | ||
|
|
||
| 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 | - | | ||
|
|
||
| ### Example | ||
| ```json | ||
| { | ||
| "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" | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ### 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. | ||
|
|
||
| ## Full Envelope Example | ||
|
|
||
| ```json | ||
| {"event_id":"9ec79c33ec9942ab8353589fcb2e04dc","sent_at":"2024-03-19T15:18:27.581Z","sdk":{"name":"sentry.javascript.react","version":"7.105.0"}} | ||
| {"type":"feedback"} | ||
| { | ||
| "event_id": "9ec79c33ec9942ab8353589fcb2e04dc", | ||
| "timestamp": "2011-05-02T17:41:36Z", | ||
| "platform": "javascript", | ||
| "level": "error", | ||
| "contexts": { | ||
| "organization": { "id": "0", "slug": "sentry" }, | ||
| "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" | ||
| } | ||
| }, | ||
| "environment": "prod", | ||
| "release": "frontend@f00", | ||
| "sdk": { | ||
| "integrations": [ | ||
| "BrowserTracing", | ||
| "BrowserProfiling", | ||
| "Replay", | ||
| "ReplayCanvas" | ||
| ], | ||
| "name": "sentry.javascript.react", | ||
| "version": "7.105.0" | ||
| }, | ||
| "tags": { | ||
| "sentry_version": "24.4.0.dev0", | ||
| }, | ||
| "user": { | ||
| "ip_address": "127.0.0.1", | ||
| "email": "[email protected]", | ||
| "id": 1, | ||
| "name": "Admin" | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ## Feedback SDK Pipeline | ||
|
|
||
| A feedback captured by capture_feedback is processed by the SDK. Note: The event can be discarded at any of the stages, at which point no further processing happens. | ||
|
|
||
| ### BeforeSendFeedback | ||
|
|
||
| SDKs should implement a `beforeSendFeedback` callback to allow users to modify the feedback before it is sent. This callback should be similar to the existing [`beforeSend`](/sdk/expected-features/#before-send-hook) callback used for events. | ||
|
|
||
| ### 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. | ||
stefanosiano marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ### 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 | ||
|
|
||
| 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/). | ||
|
|
||
| ### 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. | ||
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.