Skip to content
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

panels using a variable datasource for clickhouse breaks the jump to the explore view #819

Closed
TimSimmons opened this issue May 7, 2024 · 5 comments

Comments

@TimSimmons
Copy link

What happened:

When using a datasource templating variable to choose the Clickhouse datasource, the option on the panel to take the query to the Explore view does not bring the queries along.

explorebug

The issue seems to be that the generated link does not include the queries explore URL json bit.

in the working example the URL becomes something like:

https://grafana.../explore?left={"datasource":"aacae971-0501-4971-afc1-db92f3bd0522","queries":[{"datasource":{"type":"grafana-clickhouse-datasource","uid":"aacae971-0501-4971-afc1-db92f3bd0522"},"editorType":"sql","format":1,"meta":{"builderOptions":{"columns":[],"database":"","limit":1000,"mode":"list","queryType":"table","table":""}},"pluginVersion":"4.0.6","queryType":"table","rawSql":"SHOW TABLES from system;","refId":"A"}],"range":{"from":"now-6h","to":"now"}}&orgId=1

With the variable datasource it becomes

https://grafana.../explore?left={"datasource":"aacae971-0501-4971-afc1-db92f3bd0522","queries":[],"range":{"from":"now-6h","to":"now"}}&orgId=1

What you expected to happen:

Both panels should have had the same behavior.

How to reproduce it (as minimally and precisely as possible):

Create a new dashboard with a panel utilizing a clickhouse datasource to do anything.

Create a datasource variable that results in the same clickhouse datasource:

Screen Shot 2024-05-07 at 17 30 25

Copy the panel, but change the datasource to use the ${datasource} variable, rather than explicitly selecting the clickhouse datasource.

Click the explore link on each panel.

I have observed this with the --Mixed-- datasource as well using both a Prometheus and Clickhouse query.

Environment:

  • Grafana version: Grafana v10.0.2
  • Plugin version: 4.0.6
  • OS Grafana is installed on: Linux
  • User OS & Browser: OSX/Firefox/Chrome
@TimSimmons
Copy link
Author

TimSimmons commented May 9, 2024

I've noticed similar issues when using a variable datasource with a regular panel in a dashboard where if you change the variable name of the datasource, the queries in the panel revert to being empty with a default datasource chosen.

Similarly when pasting a panel from another dashboard where the variable name was different.

@bossinc
Copy link
Collaborator

bossinc commented May 9, 2024

@TimSimmons, from my testing, this is an issue with every data source in Grafana v10.0.2. I am not sure when this was fixed, but this does not happen in the current version of Grafana (v11.0)

@TimSimmons
Copy link
Author

Interesting, this doesn't happen with my prometheus datasources but I'll test with v11.0+clickhouse!

@TimSimmons
Copy link
Author

Indeed with the v11.0 preview my reproduction no longer breaks. The copying of the panel is still broken, but that's probably less of an issue for me. I'll look forward to the official v11.0 release!

@SpencerTorres
Copy link
Collaborator

Sounds like an issue that has been fixed within Grafana, I will close this for now. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

4 participants