Steganography at scale: Embedding share URLs in Datadog widget screenshots (opens in new tab)
Datadog is building a way for screenshots to preserve the context normally available through share links. The system invisibly embeds a compact widget identifier into screenshot pixels, while storing the full widget definition in Redis. This approach aims to combine screenshots’ convenience with share links’ ability to restore queries, time ranges, and dashboard state, at massive scale. ## From Share Links to Context-Aware Screenshots - Copying a Datadog widget creates a backend record and places a unique share URL on the clipboard. - Pasting the URL into a dashboard or notebook restores the widget. - Slack and Teams integrations can render a live preview linking back to Graph Explorer. - Screenshots remain popular because they are quick, intuitive, and visually consistent. - However, screenshots normally lose: - The time range - Underlying queries - Visualization type - Dashboard state - Template variables and other configuration ## Storing a Compact Snapshot Reference - A complete widget definition can be about 2 kB, including queries, display settings, legends, titles, time ranges, dimensions, and deep links. - Encoding all of that directly into an image would be impractical. - Instead, Datadog stores the full definition in Redis and embeds only a randomly generated snapshot ID in the screenshot. - Snapshot records are retained for one hour because screenshots are typically pasted within seconds or minutes. - The frontend generates IDs optimistically so watermarks appear immediately, before the backend cache operation completes. - Redis keys include the organization ID, preventing collisions between different customers. - An 8-byte identifier provides roughly 2⁶⁴ possible values; under the stated traffic assumptions, the estimated collision risk is about one in 37 million. ## Encoding Data in Widget Borders - Every dashboard widget has a uniform, 1-pixel border, making it a reliable place to add metadata without visualization-specific code. - An initial design used individual pixels with two colors to represent bits, but encoding 64 bits would require at least 64 pixels and could become visible. - The chosen approach stores multiple bits in each pixel’s RGB channels. - Each color channel is offset from the base border color by up to seven values, allowing up to nine bits per pixel. - Two sentinel pixels, encoded with maximum RGB offsets, mark the beginning and end of the watermark. - Because the encoded pixels remain close to the border’s original color, the watermark is intended to remain imperceptible while remaining recoverable by software. ## Scaling and Collision Considerations - Datadog renders more than one billion widgets per day, with peaks of roughly 35,000 widgets per second. - The watermark design therefore has to minimize payload size while supporting high throughput. - Shorter identifiers are easier to hide but increase collision risk, requiring organization-scoped keys and carefully chosen identifier sizes. Datadog’s design uses screenshots as lightweight carriers for references rather than embedding complete widget data. By combining subtle border-based pixel encoding with short-lived Redis snapshots, screenshots can potentially regain the contextual and interactive benefits of share links without changing their appearance.