-
-
Notifications
You must be signed in to change notification settings - Fork 220
Add screenshot context
#659
Conversation
|
@timfish is attempting to deploy a commit to the Sentry Team on Vercel. A member of the Team first needs to authorize it. |
AbhiPrasad
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sharing with the team so we can get more feedback!
|
|
||
| Each key of `screenshot` should match the filename of an attachment. An SDK can | ||
| include any additional information to helps determine the state of an windows | ||
| and which screenshot is most relevant to the event. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we introduce a more opinionated schema for now?
type ScreenshotContext = {
[key: string]: {
focus?: boolean;
errored?: boolean;
} & Record<string, unknown>,
};There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about this info going in the attachment envelope header?
Somehow being made available to the attachment, the data is used by the thumbnail component in the UI
|
We have some specs for screenshot. Probably the more relevant one would be the first screenshot, all others are just additional attachments. Front only displays the first one for now. |
|
Is there a reason this isnt handled through the attachments API? For example adding metadata to the attachment itself? It feels like an anti-pattern to disconnect the data in this way. I dont really see a reason we can't take all images and just render them in a gallery, and if we really need one to pull it out, we could just allow the ability to mark a primary (again, via attachment metadata). Otherwise this feels like we're bleeding internals into contexts, and contexts are supposed to just be additional contextual information. |
|
We chatted about attaching metadata to attachments in a previous TSC: https://www.notion.so/sentry/Screenshots-TXN-Heuristics-Mutability-357f4b9365cc41228e36ed6286cb5b24#42b3c1f74b2a462fb3307ed1404a8d06. Linking notes below as this is a private notion doc. We decided against the attachment metadata because of the difficulty with custom attributes on the indexing side - perhaps @jan-auer can clarify here. |
|
A quick idea I had. As per https://develop.sentry.dev/sdk/envelopes/#attachment, we do have the @bruno-garcia @timfish thoughts on the above? |
|
Why do we care about filenames? I feel like im missing something or we're overthinking this problem. Are we trying to build a UI that shows explicitly labeled states? Do we really need that? is it really superior to just showing a gallery? The simpler we can make the MVP here the less re-work we may have in the future if we need to augment things for different paradigms? Like, why cant we just use the attachment alt text/title/label to indicate what it is, rather than creating additional complexity here? Keep in mind we can basically never delete SDK schema. |
This makes sense to me. I think the solution in this PR isn't the way to go.
This also makes sense to me. But it requires some context to the reader to understand why it is a good way forward.
The screenshot thumbnail component relies on convention to detect a screenshot. It's basically "attachment with file name We document for customers here: https://docs.sentry.io/platforms/android/enriching-events/screenshots/
The UI is super simple right now and only shows 1 screenshot. We understood the limitation of devices with multiple screens but that wasn't a concern for us to ship the first version. In particular for mobile that multiple screen devices are super rare, for now. Adding the new attachment type as @AbhiPrasad suggested would help us expand the screenshots feature without concern to impact in the overall attachments type. I believe @jan-auer also had thoughts on this matter and might want to chime in.
👍 |
|
@bruno-garcia would it be bad to not just throw any screenshots up there? make it so you can cycle through them, and make it work beyond mobile? you could still mimetype detect. i get its not 100% the same, but i dont really think its worse. you could also aspect-ratio detect to find a desired primary photo |
We can definitely do that. I'm just not sure then if the imagine in that case is "worthy" of being put on top of the issues detail page. The idea for screenshots was that it was indeed very important, hence the thumbnail was focused on screenshot. Some additional context: |
|
We've decided we're gonna take another look at attaching metadata to the attachment itself - will update this PR with a link to a GH issue/new develop PR once that has been fleshed out. Thanks for raising this discussion @timfish! |

After adding screenshot capture to the Electron SDK, we realised that with multiple windows (and therefore multiple screenshots) it would be great to have some more context to help determine which screenshot is most relevant to the captured event.
Primarily it would be nice to know which window was the source of the error but it's also handy to have other context here such as window focus to have a better idea of which windows might be getting user interaction.