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

[v.10.2.x] Explore: lookup datasource by name when present in legacy URLs #87670

Closed
wants to merge 1 commit into from

Conversation

cwbriones
Copy link
Contributor

Backport 867d36f from #85222


What is this feature?

This adds another check when loading legacy compact URLs so that their datasources are resolved correctly.

Why do we need this feature?

It appears that in older versions of Grafana, certain explore URLs in the "compact" format could have their datasource set on non-mixed queries using the name of the datasource. Prior to #66286 (up to v10.0.x), these were handled correctly because explore would take no action on modifying the queries unless their datasource fields were not all the same. Even if they were not, it would choose the datasource as set on the first query but retain the others to be treated as imported queries.

In Grafana 10.1.X this behavior changed to remove all queries whose datasource field was set and not equal to that of the root value. In particular, the code assumes that if the field is set to a string then it is the datasource UID. Since it is instead the name in these URLs, the queries are removed by the filter.

By modifying the filter to allow the name these URLs work again correctly in the latest version of Grafana. Since the decision was made to continue supporting legacy URLs, it seems appropriate to fix this.

Who is this feature for?

This is likely most useful for long term users of Grafana who may have older explore URLs sprinkled in docs, code comments, or other tooling.

Special notes for your reviewer:

Please check that:

  • It works as expected from a user's perspective.
  • If this is a pre-GA feature, it is behind a feature toggle.
  • The docs are updated, and if this is a notable improvement, it's added to our What's New doc.

@grafana-pr-automation grafana-pr-automation bot added area/frontend area/explore pr/external This PR is from external contributor labels May 10, 2024
@cwbriones cwbriones closed this May 13, 2024
@cwbriones
Copy link
Contributor Author

Decided to backport into 10.4.x instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/explore area/frontend pr/external This PR is from external contributor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant