clickhouse-grafana
clickhouse-grafana copied to clipboard
Tooltip is not formatted - TimeSeries panel - 9.3.X+
Hi @Slach ,
Description:
After upgrading to Grafana 9.3.X, with the latest version of plugin (2.5.3), on TimeSeries panel, the tooltip information is not formated as the legend:
It happens when the user tries to change the timerange or the series changes due to variables/templating.
I have tried to debug a bit and test other Datasources and the problems seems to the way that the Dataframe is built and the current Grafana version is not able to format it...
Apologies for opening this issue here instead of Grafana, but wanted to share with you, as I'm not sure that the Draframe is being built as it should
Tested with:
- plugin version: 2.5.3
- grafana 9.3.0 (KO), 9.3.7(KO), 9.4.7 (KO), main[pre 9.5] (KO)
Note:
- grafana 9.2.15 (OK)
Repro case:
- Create a Dashboard with altinity-grafana as DS and use some query like the following:
SELECT
$timeSeries as t,
count(<field>) as field,
<group_column>
FROM $table
WHERE $timeFilter
GROUP BY t, <group_column>
ORDER BY t, <group_column>
- Validate that when the user changes the timeRange the tooltip differs from legend and it takes format as:
{name="<group_column_value>"}
-
Extract the Dataframe
-
Create new panel using TestDB as Datasource, select RAW Frame and paste the extracted Dataframe:
-
Validate that the problem is directly related with the current Dataframe spec
Example:
The following Dataframe has been extracted from CH query and modified in order to let you to reproduce the case: group_column_value = {"serie A"|"serie B"}
[
{
"schema": {
"name": "serie A",
"fields": [
{
"name": "Time",
"type": "time",
"config": {}
},
{
"name": "Value",
"type": "number",
"config": {}
}
]
},
"data": {
"values": [
[
1681776060000
],
[
1
]
]
}
},
{
"schema": {
"name": "serie B",
"fields": [
{
"name": "Time",
"type": "time",
"config": {}
},
{
"name": "Value",
"type": "number",
"config": {}
}
]
},
"data": {
"values": [
[
1681776060000
],
[
1
]
]
}
}
]
Hi @Slach , to add more info, I found that on the following Grafana dashboard there is the same behaviour, as the legend values is different than the shown tooltip
https://play.grafana.org/d/data-frame-scenarios-timeseries-panel/data-frame-scenarios-timeseries-panel?orgId=1&var-scenario=multi-frame&var-resultState=success&var-generator=frontend
Note that if you edit the panel and you add a "dummy" transformation like Join by fields -> OUTER Time
and then you disable it again, the tooltip is well formatted. For some reason its the first time that it renders the panel...
My experience has been that the tooltips are correctly formatted on first load, but any change after that causes this issue to occur. That includes an automatic reload of the data on the page...
@Slach , @cjw296 as I supposed, it was a Grafana problem.
The following PR https://github.com/grafana/grafana/pull/69289 fixes it (tested locally with docker :main
) and working fine.
Note the related issue, as some other DS plugin owner reported it to Grafana
@Slach , as it is suggested, a legacy format (Time/Value) is being used, it would be convenient to adapt to the recommended dataframe format
Closing this issue. Thanks, Regards
@sbengo thanks for sharing your feedback
Hi @Slach , we have upgraded Grafana to 10.0.3 and I was wrong: the issue has been fixed when the user changes the variables, but for some reason, when the user changes the range time, the panel renders with bad format, as explained on this issue.
I think that Grafana team missed that case, as I reproduced it on the play.grafana dashboard:
https://play.grafana.org/d/data-frame-scenarios-timeseries-panel/data-frame-scenarios-timeseries-panel?orgId=1&var-scenario=multi-frame&var-resultState=success&var-generator=frontend
@Slach , I have already asked on the original issue: https://github.com/grafana/grafana/issues/69207#issuecomment-1700392085
@sbengo let's wait when https://github.com/grafana/grafana/issues/74281 will resolve