Repository navigation
feat(browser-starfish): add initial ui to enable image view - #62223
Conversation
| <div style={{width: '100%', wordWrap: 'break-word'}}> | ||
| <img src={src} style={{minWidth: imageWidth, height: '200px'}} /> | ||
| {showImage && !hasError ? ( | ||
| <img onError={() => setHasError(true)} src={src} style={commonStyles} /> |
There was a problem hiding this comment.
@AbhiPrasad Do you know if errors from images that fail to load will become issues in our sentry project? As we will expect errors here, we wouldn't want them to report them to sentry. Although something interesting here would be to collect metrics on how often images aren't available or are available, maybe with Javascript DDM??
There was a problem hiding this comment.
By default we don't collect errors from resource 404s. See: https://blog.sentry.io/fallbacks-for-http-404-images-in-html-and-javascript/ for more info.
Although something interesting here would be to collect metrics on how often images aren't available or are available, maybe with Javascript DDM
Yes we can totally do that. Every time an image loads we can increment a metric.
// status is either `ok` or `error` based on if the image was available or not
Sentry.metrics.increment('performance.resource.image_load', 1, { tags: { status } });We need to put the Sentry.metrics.increment in a useEffect call because it's a side effect.
There was a problem hiding this comment.
👍 I'll add this in another PR, as it won't be useful until we release.
Work for #60482 1. Adds a basic UI to enable disable image view. <img width="1264" alt="image" src="https://github.com/getsentry/sentry/assets/44422760/a58d6ce6-7bc0-4edf-9a9f-5491fb1fac66"> 2. When you select show only links the following is shown <img width="1255" alt="image" src="https://github.com/getsentry/sentry/assets/44422760/a804efe5-4481-4c4b-bc61-43fb72659d87"> 3. If you select go to settings, you go to the performance page settings. 4. If an image has an error, we will display the grey box again <img width="753" alt="image" src="https://github.com/getsentry/sentry/assets/44422760/2654013d-e9b3-4891-86c2-2ba48d6c2030"> A couple TODOs to actually use this 1. We don't have an image icon, going to work on that in a future PR, an SVG is probably okay here? 2. We need to merge in #62131 and #62025 to have the actual setting
Work for #60482
If you select go to settings, you go to the performance page settings.
If an image has an error, we will display the grey box again
A couple TODOs to actually use this