# How to heatmap a timeseries?

**URL:** <https://community.dynatrace.com/t/how-to-heatmap-a-timeseries/53311>\
**Category:** Dashboarding\
**Tags:** dashboards, timeseries\
**Created:** [September 11, 2025, 5:27pm UTC](https://community.dynatrace.com/t/how-to-heatmap-a-timeseries/53311 "2025-09-11T17:27:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ronmacdonald](https://avatars.discourse-cdn.com/v4/letter/r/a88e57/32.png) [@ronmacdonald](https://community.dynatrace.com/u/ronmacdonald)\
**Post date:** [September 11, 2025, 5:27pm UTC](https://community.dynatrace.com/t/how-to-heatmap-a-timeseries/53311/1 "2025-09-11T17:27:27Z")

</div>

I have timeseries metrics with common meta-data.&nbsp; The first is the count of “calls”, the second is duration of calls.&nbsp; I’d like to create a heat map with the data to quickly identify distribution of call volume by response time across a full week.&nbsp; To do this would have x-axis as `day of the week`, y-axis as `range of durations`, and the value the number of calls.

I’m thinking something like:

Starting with this: `timeseries { avg=avg(otel.tyk.duration), calls=sum(otel.tyk.calls) }&nbsp;  
…  
Finishing with this: `| summarize calls=sum(calls), by:{range(duration), 100ms, day_of_week}`

Unsure of the middle and how to unwind the 2 timeseries metrics to get the day of week range, that would allow me to finish…

---

<div class="post-metadata">

**Author:** ![MichalGebacki](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/michalgebacki/32/41585_2.png) [@MichalGebacki](https://community.dynatrace.com/u/MichalGebacki)\
**Post date:** [November 28, 2025, 12:04pm UTC](https://community.dynatrace.com/t/how-to-heatmap-a-timeseries/53311/2 "2025-11-28T12:04:51Z")

</div>

Hello,&nbsp;[@ronmacdonald](https://community.dynatrace.com/user/5224)!

There’s a documentation page about [**Heatmap visualization**](https://docs.dynatrace.com/docs/analyze-explore-automate/dashboards-and-notebooks/edit-visualizations/visualization-heatmap) in the Dynatrace Documentation. Can you take a look at this please and let us know whether is it helping your issue in any way?

Thank you for collaboration!

---

<div class="post-metadata">

**Author:** ![t\_pawlak](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/t_pawlak/32/14991_2.png) [@t\_pawlak](https://community.dynatrace.com/u/t_pawlak)\
**Post date:** [November 28, 2025, 4:00pm UTC](https://community.dynatrace.com/t/how-to-heatmap-a-timeseries/53311/3 "2025-11-28T16:00:51Z")

</div>

Hi,

I tried to build the heatmap you described and here are the findings.

Using metrics alone (e.g., avg(duration) and sum(calls)) it’s not possible to derive a distribution of calls across duration buckets. Timeseries metrics don’t contain per-call durations, so DQL can’t “unwind” them into individual events.

To calculate the distribution correctly you need to use span-level data, which contains the actual duration of every call.  
For example:

```markup
fetch spans
| fieldsAdd
    day_of_week = getDayOfWeek(start_time),
    duration_bucket = range(duration, duration(100, "ms"))
| summarize calls = count(), by: { day_of_week, duration_bucket }
| sort day_of_week asc

```

This produces a clean distribution table (day of week × duration bucket × calls).  
However, Dynatrace heatmap does not support span-based queries, so even with correctly shaped data this cannot be visualized as a heatmap.

 ![t_pawlak_0-1764345540429.png](https://global.discourse-cdn.com/dynatrace/original/3X/d/c/dcedf315550c5f6f92fd9cd7234111954128cb24.png)

I also tried converting the buckets into strings:

```markup
fetch spans
| fieldsAdd
    day = formatTimestamp(start_time, format:"EEE"),
    bucket = concat(
        toLong(duration / duration(100,"ms")) * 100,
        "-",
        toLong(duration / duration(100,"ms")) * 100 + 100,
        " ms"
    )
| summarize calls = count(), by: { day, bucket }
| sort day asc, bucket asc

```

This gives the right structure (string/string/number), but heatmap still rejects it because the heatmap visualization currently works only for metric-based queries, not for span/log/event queries.

 ![t_pawlak_1-1764345630653.png](https://global.discourse-cdn.com/dynatrace/original/3X/a/5/a547c38309605fb275b533d4ef8b2947e5f219c1.png)

You can try this on your data
