You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
By clicking “Sign up for GitHub”, you agree to our
terms of service
and
privacy statement
. We’ll occasionally send you account related emails.
Already on GitHub?
Sign in
to your account
What happened
:
Grafana heatmap panel shows:
RangeError: invalid array length
with a histogram_quantile() query which returns some data points and NaN.
What you expected to happen
:
A heatmap with empty spots and the data points.
If no data at all it should show "No data".
How to reproduce it (as minimally and precisely as possible)
:
Anything else we need to know?
:
It works with grafana 9.2.0 as expected.
Changing the graph type to for example time series works. It shows the data points and nothing for NaN.
Environment
:
Grafana version: v9.3.1
Data source type & version: prometheus
Thanks for creating this issue,
@raffis
could you please copy and past all relevant data using the
panel --> more --> get help
workflow in the panel's dropdown menu? This will help up mock up your data and reproduce your issue. It is important to our teams that issues get verified as reproducible before we formally mark them as bugs. Thank you!
here are more details and steps for copying your data over to this issue:
https://grafana.com/docs/grafana/latest/troubleshooting/send-panel-to-grafana-support/
"cardColor"
:
"
#b4ff00
"
,
"colorScale"
:
"
sqrt
"
,
"colorScheme"
:
"
interpolateOranges
"
,
"exponent"
:
0.5
,
"mode"
:
"
spectrum
"
"dataFormat"
:
"
timeseries
"
,
"fieldConfig"
: {
"defaults"
: {
"custom"
: {
"scaleDistribution"
: {
"type"
:
"
linear
"
"hideFrom"
: {
"tooltip"
:
false
,
"viz"
:
false
,
"legend"
:
false
"overrides"
: []
"heatmap"
: {},
"hideZeroBuckets"
:
false
,
"highlightCards"
:
true
,
"options"
: {
"calculate"
:
true
,
"yAxis"
: {
"axisPlacement"
:
"
left
"
,
"reverse"
:
false
,
"unit"
:
"
s
"
"rowsFrame"
: {
"layout"
:
"
auto
"
"color"
: {
"mode"
:
"
scheme
"
,
"fill"
:
"
#b4ff00
"
,
"scale"
:
"
exponential
"
,
"exponent"
:
0.5
,
"scheme"
:
"
Oranges
"
,
"steps"
:
128
,
"reverse"
:
false
"cellGap"
:
2
,
"filterValues"
: {
"le"
:
1e-9
"tooltip"
: {
"show"
:
true
,
"yHistogram"
:
false
"legend"
: {
"show"
:
true
,
"showLegend"
:
true
"exemplars"
: {
"color"
:
"
rgba(255,0,255,0.7)
"
"calculation"
: {},
"cellValues"
: {},
"showValue"
:
"
never
"
"reverseYBuckets"
:
false
,
"targets"
: [
"refId"
:
"
A
"
,
"datasource"
: {
"type"
:
"
grafana
"
,
"uid"
:
"
grafana
"
"queryType"
:
"
snapshot
"
,
"snapshot"
: [
"schema"
: {
"refId"
:
"
A
"
,
"meta"
: {
"type"
:
"
timeseries-many
"
,
"custom"
: {
"resultType"
:
"
matrix
"
"executedQueryString"
:
"
Expr: histogram_quantile(0.99, sum(rate(http_server_requests_seconds_bucket{service='svc-contact-provider',uri=
\"
/web/contact-suggestions
\"
}[5m])) by (le))
\n
Step: 30m0s
"
,
"preferredVisualisationType"
:
"
graph
"
"name"
:
"
histogram_quantile(0.99, sum(rate(http_server_requests_seconds_bucket{service='svc-contact-provider',uri=
\"
/web/contact-suggestions
\"
}[5m])) by (le))
"
,
"fields"
: [
"name"
:
"
Time
"
,
"type"
:
"
time
"
,
"typeInfo"
: {
"frame"
:
"
time.Time
"
"config"
: {
"interval"
:
1800000
"name"
:
"
Value
"
,
"type"
:
"
number
"
,
"typeInfo"
: {
"frame"
:
"
float64
"
"labels"
: {},
"config"
: {
"displayNameFromDS"
:
"
histogram_quantile(0.99, sum(rate(http_server_requests_seconds_bucket{service='svc-contact-provider',uri=
\"
/web/contact-suggestions
\"
}[5m])) by (le))
"
"data"
: {
"values"
: [
1672221600000
,
1672263000000
,
1672468200000
,
1672509600000
,
1672756200000
,
1673965800000
,
1674046800000
2.4288536600274275
,
null
,
null
,
null
,
null
,
null
,
"tooltip"
: {
"show"
:
true
,
"showHistogram"
:
false
"xAxis"
: {
"show"
:
true
"yAxis"
: {
"format"
:
"
s
"
,
"logBase"
:
1
,
"show"
:
true
"yBucketBound"
:
"
auto
"
"gridPos"
: {
"h"
:
7
,
"w"
:
9
,
"x"
:
15
,
"y"
:
0
"id"
:
5
,
"options"
: {
"content"
:
"
<table width=
\"
100%
\"
>
\n
<tr>
\n
<th width=
\"
2%
\"
>Panel</th>
\n
<td >heatmap @ 9.3.2</td>
\n
</tr>
\n
<tr>
\n
<th>Queries</th>
\n
<td>A[prometheus]</td>
\n
</tr>
\n
\n
<tr><th>Data</th><td> 1 frames, 2 fields, 7 rows </td></tr>
\n
\n
<tr>
\n
<th>Grafana</th>
\n
<td>9.3.2 (21c1d14e91) // Open Source</td>
\n
</tr>
\n
</table>
"
,
"mode"
:
"
html
"
"title"
:
"
Debug info
"
,
"type"
:
"
text
"
"id"
:
6
,
"title"
:
"
Original Panel JSON
"
,
"type"
:
"
text
"
,
"gridPos"
: {
"h"
:
13
,
"w"
:
9
,
"x"
:
15
,
"y"
:
7
"options"
: {
"content": "{\n \"id\": 7,\n \"gridPos\": {\n \"x\": 16,\n \"y\": 10,\n \"w\": 8,\n \"h\": 7\n },\n \"type\": \"heatmap\",\n \"title\": \"Service contact-suggestions endpoint histogram\",\n \"datasource\": {\n \"uid\": \"$datasource\",\n \"type\": \"prometheus\"\n },\n \"pluginVersion\": \"9.3.2\",\n \"legend\": {\n \"show\": true\n },\n \"cards\": {},\n \"color\": {\n \"cardColor\": \"#b4ff00\",\n \"colorScale\": \"sqrt\",\n \"colorScheme\": \"interpolateOranges\",\n \"exponent\": 0.5,\n \"mode\": \"spectrum\"\n },\n \"dataFormat\": \"timeseries\",\n \"fieldConfig\": {\n \"defaults\": {\n \"custom\": {\n \"scaleDistribution\": {\n \"type\": \"linear\"\n },\n \"hideFrom\": {\n \"tooltip\": false,\n \"viz\": false,\n \"legend\": false\n }\n }\n },\n \"overrides\": []\n },\n \"heatmap\": {},\n \"hideZeroBuckets\": false,\n \"highlightCards\": true,\n \"options\": {\n \"calculate\": true,\n \"yAxis\": {\n \"axisPlacement\": \"left\",\n \"reverse\": false,\n \"unit\": \"s\"\n },\n \"rowsFrame\": {\n \"layout\": \"auto\"\n },\n \"color\": {\n \"mode\": \"scheme\",\n \"fill\": \"#b4ff00\",\n \"scale\": \"exponential\",\n \"exponent\": 0.5,\n \"scheme\": \"Oranges\",\n \"steps\": 128,\n \"reverse\": false\n },\n \"cellGap\": 2,\n \"filterValues\": {\n \"le\": 1e-9\n },\n \"tooltip\": {\n \"show\": true,\n \"yHistogram\": false\n },\n \"legend\": {\n \"show\": true,\n \"showLegend\": true\n },\n \"exemplars\": {\n \"color\": \"rgba(255,0,255,0.7)\"\n },\n \"calculation\": {},\n \"cellValues\": {},\n \"showValue\": \"never\"\n },\n \"reverseYBuckets\": false,\n \"targets\": [\n {\n \"datasource\": {\n \"type\": \"prometheus\",\n \"uid\": \"$datasource\"\n },\n \"exemplar\": true,\n \"expr\": \"histogram_quantile(0.99, sum(rate(http_server_requests_seconds_bucket{service='$svc_name',uri=\\\"/web/contact-suggestions\\\"}[5m])) by (le))\",\n \"interval\": \"\",\n \"legendFormat\": \"\",\n \"refId\": \"A\",\n \"editorMode\": \"code\",\n \"range\": true\n }\n ],\n \"tooltip\": {\n \"show\": true,\n \"showHistogram\": false\n },\n \"xAxis\": {\n \"show\": true\n },\n \"yAxis\": {\n \"format\": \"s\",\n \"logBase\": 1,\n \"show\": true\n },\n \"yBucketBound\": \"auto\"\n}",
"mode"
:
"
code
"
,
"code"
: {
"language"
:
"
json
"
,
"showLineNumbers"
:
true
,
"showMiniMap"
:
true
"id"
:
3
,
"title"
:
"
Data from panel above
"
,
"type"
:
"
table
"
,
"datasource"
: {
"type"
:
"
datasource
"
,
"uid"
:
"
-- Dashboard --
"
"gridPos"
: {
"h"
:
7
,
"w"
:
15
,
"x"
:
0
,
"y"
:
13
"options"
: {
"showTypeIcons"
:
true
"targets"
: [
"datasource"
: {
"type"
:
"
datasource
"
,
"uid"
:
"
-- Dashboard --
"
"panelId"
:
2
,
"withTransforms"
:
true
,
"refId"
:
"
A
"
"schemaVersion"
:
37
,
"title"
:
"
Debug: Service contact-suggestions endpoint histogram // 2023-01-26 12:40:46
"
,
"tags"
: [
"
debug
"
,
"
debug-heatmap
"
"time"
: {
"from"
:
"
2022-12-27T11:40:46.305Z
"
,
"to"
:
"
2023-01-26T11:40:46.305Z
"
triage/needs-confirmation
used for OSS triage rotation - reported issue needs to be reproduced
and removed
needs more info
Issue needs more information, like query results, dashboard or panel json, grafana version etc
labels
Feb 14, 2023
I've also observed this error. It appears it might be related to
none
values in the query result.
I'm using Influxdb as the datasource, and there's some gaps in the data. If I select
fill(none)
, I get the same RangeError.
Switching to
fill(0)
or
fill(null)
resolves the error (but means the data isn't visualized in the intended way).
We're running Grafana
9.2.3
.
i'm not able to reproduce the original issue on
main
with the debug panel containing
null
values; they appear to be treated as
0
:
since it would reduce performance to omit any unexpected values from the heatmap calculation, which can deal with hundreds of thousands of points, you should try to either filter the values out in the query, or use an explicit Filter transform to remove them so this cost is only borne by users who need it:
we do have another issue in this panel with rendering only a single cell, as in the attached debug snapshot. but that is a separate issue.
We're also seeing this with grafana 9.5.1 but not 9.4.3
this is due to the timestamps being un-ordered, once we combine all 202 frames. i have a fix ready:
triage/needs-confirmation
used for OSS triage rotation - reported issue needs to be reproduced
label
May 9, 2023