Altinity / clickhouse-grafana

Altinity Grafana datasource plugin for ClickHouse®
MIT License
715 stars 120 forks source link

SQL Query Reset Issue in Panels with Multiple Clickhouse Altinity Datasources #604

Closed LeThaumaturge closed 1 month ago

LeThaumaturge commented 1 month ago

Description:

Hello,

I am encountering an issue with the Clickhouse-Grafana plugin when editing a panel that includes multiple Clickhouse Altinity datasources in mixed mode.

Observed Behavior:

When I edit a panel with multiple Clickhouse Altinity datasources, the SQL query for the first datasource is consistently reset to the following default content: SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t

This is problematic because it's easy to lose custom configurations if not careful.

Steps to Reproduce the Issue:

Note: There is no problem if you use the same datasource twice (datasourceA and datasourceA). Note 2 : There is no problem with previous major version (version 2.5.4 is fine).

Expected Behavior:

The SQL query for each datasource should remain unchanged after editing the panel unless explicit modifications are made.

Additional Information:

Grafana Version: 10.3.6 Clickhouse Plugin Version: 3.2.1 (latest) Browser: 6.8.3381.50 (Stable channel) (arm64)

Best regards,

Slach commented 1 month ago

Thank you so much for reporting, could you make a screencast with wrong behavior to better understanding?

@antip00 could we make e2e test for this scenario?

LeThaumaturge commented 1 month ago

@Slach for sure, here is an example :

https://github.com/user-attachments/assets/6fd139a4-4cde-4751-a20b-292f376b4adb

note: sorry for the multiple updates; I had to modify the attachment.