---
title: "How we built the Datadog heatmap to visualize distributions over time at arbitrary scale"
description: "Datadog's heatmap visualizes DDSketch-backed distribution metrics over time, revealing multimodal behavior (such as pulsing benchmark traffic or health-check modes) that percentile lines hide."
url: "https://swe.quest/articles/how-we-built-the-datadog-heatmap-to-visualize-distributions-over-time-at-771a93f5eee96301"
canonical: "https://www.datadoghq.com/blog/engineering/how-we-built-the-datadog-heatmap-to-visualize-distributions-over-time-at-arbitrary-scale/"
source: "Datadog Engineering"
published: "2024-05-01"
difficulty: "medium"
kind: "Case study"
reading_minutes: 13
tags: ["observability","frontend","web-performance","data-structures"]
---

# How we built the Datadog heatmap to visualize distributions over time at arbitrary scale

A post on [Datadog Engineering](https://swe.quest/sources/datadog.md), published 2024-05-01, 13 min read, Case study. Original: [https://www.datadoghq.com/blog/engineering/how-we-built-the-datadog-heatmap-to-visualize-distributions-over-time-at-arbitrary-scale/](https://www.datadoghq.com/blog/engineering/how-we-built-the-datadog-heatmap-to-visualize-distributions-over-time-at-arbitrary-scale/)

## Summary

Datadog's heatmap visualizes DDSketch-backed distribution metrics over time, revealing multimodal behavior (such as pulsing benchmark traffic or health-check modes) that percentile lines hide. The frontend receives a constant-size payload of float32 bin counts with shared, explicitly stored bucket boundaries. Time buckets must align to the data's reporting interval to avoid aliasing. Because counts often follow power-law distributions, the color scale is a heuristic blend of linear and histogram-equalized (percentile) interpolation, so both a dominant narrow mode and faint secondary modes stay visible. Rendering switches to per-pixel canvas ImageData instead of per-bin fillRect above roughly 4 raw pixels per bin, and a coarser, size-relative grid drives mouse interactions and tooltips.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Observability](https://swe.quest/tags/observability.md) (Reliability & operations)
- [Frontend](https://swe.quest/tags/frontend.md) (Web & mobile)
- [Web performance](https://swe.quest/tags/web-performance.md) (Web & mobile)
- [Data structures](https://swe.quest/tags/data-structures.md) (Architecture & design)

## Prerequisites

- percentiles and latency metrics ([easy posts on Performance engineering](https://swe.quest/tags/performance.md?difficulty=easy))
- HTML canvas basics
- histograms

## Keywords

Datadog, DDSketch, heatmap, HTML canvas, Stevens' power law, histogram equalization

## Related posts

- [Steganography at scale: Embedding share URLs in Datadog widget screenshots](https://swe.quest/articles/steganography-at-scale-embedding-share-urls-in-datadog-widget-screenshots-c180eafbb38c64ee.md): Datadog Engineering · 2026-04-21 · Medium · 20 min read · Frontend, Caching, Observability, Algorithms
  Datadog embeds an 8-byte snapshot ID invisibly into the 1 px border of every dashboard widget so screenshots can be resolved back to the full widget context (queries, time range, template variables), with definitions cached in Redis for one hour keyed by org ID plus widget ID.
- [Faster root cause for slow traces with ClickStack Event Deltas](https://swe.quest/articles/faster-root-cause-for-slow-traces-with-clickstack-event-deltas-a6101b03bbd87110.md): ClickHouse · 2025-11-03 · Medium · 9 min read · Observability, Debugging, Performance engineering
  ClickStack's Event Deltas compare a user-selected region of slow spans on a duration-over-time heatmap against the remaining inlier spans, issuing two queries and sampling both sets to surface attribute values disproportionately present in the outliers.
- [How to Export Datadog Metrics for Exploration in Jupyter Notebooks](https://swe.quest/articles/how-to-export-datadog-metrics-for-exploration-in-jupyter-notebooks-c6d7f453ea6de7b5.md): Shopify Engineering · 2022-11-29 · Medium · 4 min read · Observability, Python
  Datadog dashboards aggregate metrics more coarsely as the time window grows (e.g. 1-second points over 15 minutes become 2-hour points over 30 days), hiding short-lived events and limiting statistical analysis.
- [What's new in ClickStack - March 2026](https://swe.quest/articles/what-s-new-in-clickstack-march-2026-6679d9e481e7bb58.md): ClickHouse · 2026-04-14 · Medium · 12 min read · Observability, Analytics & OLAP, SQL
  ClickStack's March 2026 update reworks Event Deltas for root-cause analysis.
- [Level Up With Derived Columns: Understanding Screen Size (With Basic Arithmetic)](https://swe.quest/articles/level-up-with-derived-columns-understanding-screen-size-with-basic-arithmetic-32df35ce080844c4.md): Honeycomb · 2018-07-05 · Medium · 4 min read · Observability, Frontend
  Honeycomb's derived columns can compute values at query time instead of sending redundant fields from instrumentation, for example multiplying window height and width into a pixel area with MUL.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
