Description
What happened:
We are using following versions:
Grafana: v11.4.0
Grafana clickhouse-datasource plugin: v4.5.1
ClickHouse client version: 24.11.1.2557
Adhoc filters don't work on the panels with datasource variable. It works as expected when datasource is explicitly selected in the panel dropdown. In Query inspector we see that additional "additional_table_filters" setting is not getting appended in case of datasource variable is selected.
What you expected to happen:
additional_table_filters should append with datasource variable
How to reproduce it (as minimally and precisely as possible):
- Create a single Clickhouse datasource. Create a dashboard with two panels and ensure data is coming in. We are using SQL Editor to add our panel queries.
- From the "Logs" panel add a filter and notice that both the panels are showing only the filtered data.
- Create one more Clickhouse datasource. Update dashboard with a variable of type Datasources and ensure that both the Clickhouse datasources are available in the variable dropdown. Update both the panels to use the datasource variable.
- Refresh the dashboard and change the datasources to ensure that data is coming in from both the datasources and both the panels are updating
- From "Logs" panel add filter. Data won't change on both the panels [This is the problem]
How to further debug with Query Inspector:
- Edit the "Logs" panel with explicit datasource
- Expand one of the logs and filter a value
- Execute "Run Query" -> "Query Inspector" -> "Query" tab -> "Refresh" -> This will show what query was executed against Clickhouse
- Notice that the end of query is appended with "settings additional_table_filters=<your_filter>"
- Close the Query inspector and in Datasource select the Datasource variable and perform all the steps again
Screenshots
With datasource explicitly selected:
With Datasource variable:
Anything else we need to know?:
Environment:
- Grafana version: 11.4.0
- Plugin version: 4.5.1
- OS Grafana is installed on: OEL8
- User OS & Browser: MAC, Google Chrome
- Others:
Metadata
Metadata
Assignees
Labels
Type
Projects
Status