Skip to content

Conversation

@aangelisc
Copy link
Contributor

The SQL editor implementation in ClickHouse makes supporting the log volumes query challenging. The query issued for log volumes is dependant on identifying the time column which is not straightforward for raw SQL queries.

The logs panel supports a fallback function for calculating log volumes for data sources that do not inherently support the log volumes query. As ClickHouse does support the necessary query we couldn't directly use this. grafana/grafana#115348 has made the execution of this function more flexible, allowing the data source to determine if it supports the logs volume query by inspecting query attributes.

We now take advantage of this to identify if any of the queries make use of the SQL editor. If they do, we do not indicate that we support the logs volume query. In this case, the fallback function will be used instead.

Fixes #1364

image

Copy link
Collaborator

@SpencerTorres SpencerTorres left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome!

Copy link
Contributor

@adamyeats adamyeats left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM, but needs tests (unit or E2E).

bossinc
bossinc previously approved these changes Dec 15, 2025
Copy link
Collaborator

@bossinc bossinc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 LGTM!

@aangelisc aangelisc requested a review from adamyeats December 16, 2025 12:15
@adamyeats adamyeats moved this from Incoming to Needs Review in Partner Datasources Dec 16, 2025
@aangelisc aangelisc force-pushed the andreas/logs-volume-update branch from 6b73cbb to 2c57b0c Compare December 16, 2025 13:30
@aangelisc
Copy link
Contributor Author

Closing in favour of #1475

@aangelisc aangelisc closed this Dec 16, 2025
@github-project-automation github-project-automation bot moved this from Needs Review to Done in Partner Datasources Dec 16, 2025
@aangelisc aangelisc deleted the andreas/logs-volume-update branch December 16, 2025 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Support logs volume for SQL editor queries

4 participants