feat(sr): capture Icon widgets as raster images#1018
Conversation
fuzzybinary
left a comment
There was a problem hiding this comment.
Looks good to me with some minor nits.
But this needs a Golden test as well.
| final fontFamily = iconData.fontFamily; | ||
| if (fontFamily == null || fontFamily.isEmpty) { | ||
| return SpecificElement( |
There was a problem hiding this comment.
We should be able to render the Material Icons font without needing to perform a raster. I think these get captured as Text elements, so it might be worth checking for that and sending its corresponding Text element instead of performing the raster.
There was a problem hiding this comment.
It turns out this feature has a bug on the player side, so if you weren't seeing Material lcons, that's why. We're working on a fix.
(example link: https://app.datadoghq.eu/rum/replay/sessions/6a189644-871a-420c-93b0-aa2e2c1616e3?ts=1778180629349)
Note, we are noticing that datadog is dropping uploaded images. Maybe this has to do with your backend bug, maybe it's some kind of upload limit dropping oldest cache entries. @fuzzybinary
|
f8272b2 to
d961dfc
Compare
|
@nottmey The dropped uploaded images should be Android specific and fixed in preview 12. If it's not please let me know. |
|
@fuzzybinary tested it out, images are still dropped with icon rasterization + preview 12 |
Register IconRecorder in the capture pipeline, reuse identical icon rasters per recorder, and respect image privacy levels. Add example screen coverage, unit tests, and changelog entry. Made-with: Cursor feat(session_replay): add configurable icon raster logical size Rasterize icons at DatadogSessionReplayConfiguration.iconRasterLogicalSize (default 20) × DPR, cache by glyph/font/color, and dedupe concurrent work. Align glyph layout with Flutter Icon for replay; export config on public API. Made-with: Cursor feat(session_replay): add phased icon raster timings and outcome type Introduce _IconRasterOutcome so raster work reports per-phase ms (toImage, toByteData, save) and defers rich debug logging until after the shared in-flight future completes. Made-with: Cursor chore: revert icon layouting changes fix(session-replay): dispose TextPainter after icon rasterization Made-with: Cursor feat(session_replay): parallel icon processing and raster size Resolve AdditionalProcessingElement work with Future.wait so icon rasterization is not serialized. Add DatadogSessionReplayConfiguration.iconRasterLogicalSize (default 20) and plumb it into IconRecorder for canonical glyph bitmaps. Add golden coverage for Icon image privacy levels and extend icon_recorder tests. Co-authored-by: Cursor <cursoragent@cursor.com>
d961dfc to
c3cf50b
Compare
|
maybe it works for you? |
|
@gonzalezreal Can you take a look at ☝️ . The android resource id fix should have been pushed in preview 12. @nottmey Can you open a support request for that? That way we can potentially look at your replays and determine what's going on. |
|
@fuzzybinary will do, tested on an iOS simulator (fyi) |
|
support ticket: https://help.datadoghq.com/hc/requests/2894616 |
|
@fuzzybinary Just to confirm, the Android resource-context fix did land in |
|
@gonzalezreal we see dropped images on all sessions; we have the feature running in production (start/stop on a selected set of users) (feel free to check all our session recordings) yes, the screenshot and example session is done from an ios simulator; Tomorrow, I can also reproduce it on android as well and send you the matching link. |


What and why?
Iconwidgets as rasterized images with a transparent background and upload them through the same image resource pipeline asImage/RawImage. Icons are rasterized at a configurable logical size (DatadogSessionReplayConfiguration.iconRasterLogicalSize, default20) × device pixel ratio, cached by glyph + font + color so the same icon is rasterized once per recorder instance regardless of on-screenIconsize. Concurrent raster work for the same icon is deduplicated; additional per-frame capture processing runs in parallel.ImagePrivacyLevel.maskAllshows a placeholder (no upload);maskNoneandmaskNonAssetsOnlyrecord icons; the innerRichTextofIconis not captured as text.How?
Review checklist