Skip to content

Conversation

@gabor
Copy link
Contributor

@gabor gabor commented Nov 14, 2025

(part of #1419)

when a data source request is sent to Grafana, it may contain multiple queries in it. in certain scenarios, we permit to have per-query time-ranges.

originally this was done using the timeRange json attribute name. but then we realized some existing plugins have certain assumptions about that field, and that field should not exist in the JSON, to provide compatibility. so we switched from the name timeRange to _timeRange.

but this causes other complications, so we decided to go with another approach:

  • we will restore the timeRange name
  • we will make sure the timeRange does not appear in backend.DataQuery.JSON
@grafana-plugins-platform-bot grafana-plugins-platform-bot bot moved this from 📬 Triage to 🔬 In review in Plugins Platform / Grafana Community Nov 14, 2025
@gabor gabor force-pushed the gabor/change-time-range branch 2 times, most recently from 2b83029 to 10f4b60 Compare November 14, 2025 12:21
@gabor gabor changed the base branch from main to gabor/test-change November 14, 2025 12:25
Base automatically changed from gabor/test-change to main November 14, 2025 14:08
@gabor gabor marked this pull request as ready for review November 14, 2025 14:12
@gabor gabor requested a review from a team as a code owner November 14, 2025 14:12
@gabor gabor force-pushed the gabor/change-time-range branch from 10f4b60 to 5cb7a84 Compare November 14, 2025 14:34
return bq, err
}

fixedBytes, err := deleteTimeRangeFromQueryJSON(bytes)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe a note on here that we recognise it is inefficient, and why we chose to do it this way?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point, i added a comment there 👍

Copy link
Contributor

@dafydd-t dafydd-t left a comment

Choose a reason for hiding this comment

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

Gets us moving 👍

@gabor gabor merged commit 6cc3416 into main Nov 18, 2025
7 checks passed
@gabor gabor deleted the gabor/change-time-range branch November 18, 2025 12:31
@github-project-automation github-project-automation bot moved this from 🔬 In review to 🚀 Shipped in Plugins Platform / Grafana Community Nov 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants