-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
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
Unexpected behaviour with clickhouse datasource (v2.3.1) and single stat panel #403
Comments
Could you try a different approach?
I mean select |
Hello @Slach I've replaced my original .
by
now Grafana is getting strings en cat column
And still not working when only one row. |
Could you try to replace your clickhouse query format from or try to replace your query and apply $columns macro $columns(
concat('Category ',toString(cat)) as cat,
count(idx) as errors
) FROM
(
....( another big subselect)
)
GROUP BY t,cat |
Hello again @Slach . 1) With timeseries formatOption AI've tested 2 options, and neither of them are valid because main information "Category" has disappeared SELECT
1 AS t, /* fake timestamp value */
concat('Category ',toString(cat)) as cat,
count(idx) as errors
FROM
(
....( another big subselect)
)
GROUP BY t,cat this table
Option B ( without t)SELECT
concat('Category ',toString(cat)) as cat,
count(idx) as errors
FROM
(
....( another big subselect)
)
GROUP BY cat this table
2.- with $columns macrothis query
will transform to this other.
I'm not sure what is supposed to do this macro but it is failing with this error
any other suggestion ? |
Let's try remove SELECT t, groupArray((cat, errors)) AS groupArr FROM (
SELECT
1 AS t,
concat('Category ', toString(cat)) as cat,
count(idx) as errors
FROM (
....( another big subselect)
)
GROUP BY t, cat ORDER BY t, cat
)
GROUP BY t
Did you try to replace your clickhouse query format from time series to table? (look drop-down menu on bottom) |
Yes @Slach while this query. SELECT
1 AS t,
concat('Category ', toString(cat)) as cat,
count(idx) as errors
FROM (
....( another big subselect)
)
GROUP BY t, cat ORDER BY t, cat I'm getting this table.
with this result ( Formatted as Table) When adding the groupArray extension SELECT t, groupArray((cat, error)) AS groupArr FROM (
SELECT
1 AS t,
concat('Category ', toString(cat)) as cat,
count(idx) as error
FROM
(
....( another big subselect)
)
GROUP BY t, cat ORDER BY t, cat
)
GROUP BY t I got this table
And This as single stat. Configuring Numeric Fields Configuring All fields. And configuring only GroupArr field ExpectedAll previous queries and configurations never got expected result. Maybe we won't be able to configure single stats as expected if no way to get data as dataframes , see related issue (#404) |
Sorry @Slach , yes I did In all examples. See above again Here another evidence. |
ok ;) clear, thanks a lot for reporting, i will try to figure wrong behavior ASAP |
Thank you very much for your time @Slach . As I said in my first entry in this issue, we have currently working with single stats panel, and I think all this behaviour could be fixed by only getting data in grafana dataframe format ( needed for Grafana 7.0+ ). Thank you very much again for your work. |
@lunaticusgreen need to figure out how works result set with category with single stat visualization in Grafana 10 |
@Slach I checked the behavior in Grafana 10, please review and close issue if needed: If you set Text Mode to "Value and name" it shows correctly for a single stat panel with click house data source: ![]() |
@toni-moreno sorry for late reply |
@lunaticusgreen let's add |
Hello Guys. I'm trying to create a Grafana 7.5.5 Dashboard with single stat panel like in others dashboarsd we have already working fine, but with unexpected behaviour with clickhouse datasource.
Data visualization with flux/influxdb
With other datasources (flux/influxdb) we have created a singlestat that we can feed with a table like that (from chronograf)
![image](https://user-images.githubusercontent.com/5883405/148555202-52ceb0a0-b1cc-4622-84af-859215aa52d4.png)
with 2 entries.
with this singlestat result
![image](https://user-images.githubusercontent.com/5883405/148555417-067cb257-cc81-45b5-bf16-a21df7918e22.png)
or this other with 1 entry
![image](https://user-images.githubusercontent.com/5883405/148555281-a7197907-2f3c-46aa-9ad1-5686223e608a.png)
And this result.
Data visualization with clickhouse
when result for the query is that ( assuming that we should add a fake time column)
visualization is ok
when result for the query is this other.
the category column information /(tag in influxdb) disappeared.
There is any way to fix this behaviour difference with other datasources?
The text was updated successfully, but these errors were encountered: