Introduction to histograms and heatmaps

    Instead of graphing the actual values, histograms graph the buckets. Each bar represents a bucket, and the bar height represents the frequency (such as count) of values that fell into that bucket’s interval.

    This histogram shows the value distribution of a couple of time series. You can easily see that most values land between 240-300 with a peak between 260-280.

    Here is an example showing height distribution of people.

    For more information about histogram visualization options, refer to .

    Histograms only look at value distributions over a specific time range. The problem with histograms is you cannot see any trends or changes in the distribution over time. This is where heatmaps become useful.

    A heatmap is like a histogram, but over time where each time slice represents its own histogram. Instead of using bar height as a representation of frequency, it uses cells and colors the cell proportional to the number of values in the bucket.

    For more information about heatmap visualization options, refer to .

    There are a number of data sources supporting histogram over time like Elasticsearch (by using a Histogram bucket aggregation) or Prometheus (with metric type and Format as option set to Heatmap). But generally, any data source could be used if it meets the requirements: returns series with names representing bucket bound or returns series sorted by the bound in ascending order.

    If you use the heatmap with regular time series data (not pre-bucketed), then it’s important to keep in mind that your data is often already aggregated by your time series backend. Most time series queries do not return raw sample data but include a group by time interval or maxDataPoints limit coupled with an aggregation function (usually average).

    If you remove or lower the group by time (or raise maxDataPoints) in your query to return more data points your heatmap will be more accurate but this can also be very CPU and memory taxing for your browser and could cause hangs and crashes if the number of data points becomes unreasonably large.