grafana / google-bigquery-datasource

Google BigQuery Datasource Plugin for Grafana.
Apache License 2.0
26 stars 13 forks source link

Automatic migration of variables type QUERY not working #152

Closed rd-khubaib-athar closed 1 year ago

rd-khubaib-athar commented 2 years ago

Hi, I would like to report that during the migration from doitintl to grafana bigquery, we noticed that the plugin worked for the new dashboards. However, our existing dashboard use many custom Variables made in settings of the type, QUERY. They were not automatically migrated to the new plugin type. It would be great if this issue can be fixed because otherwise we are still on the old plugin(not maintained now). Is there something already in your list regarding that?

zoltanbedi commented 2 years ago

Hi @khubaibathar,

Can you please help me understand your issue? You are not able to migrate the variables query to this plugin?

rd-khubaib-athar commented 1 year ago

Hi @zoltanbedi , Yes exactly. You can find the attached screenshot for clear idea of what's missing.

Screenshot 2022-11-07 at 08 29 52

The Query for these kind of data variables are not being migrated.

zoltanbedi commented 1 year ago

Got it thank you @khubaibathar. This is not supported in grafana but should be easy to add. https://github.com/grafana/grafana/blob/main/public/app/features/dashboard/components/AnnotationSettings/AnnotationSettingsEdit.tsx#L47

rd-khubaib-athar commented 1 year ago

@zoltanbedi , i did not understand what you mentioned. Could you give me an explanation please. thanks!

zoltanbedi commented 1 year ago

@khubaibathar we need to make changes in the grafana core code to support what you are asking for.

rd-khubaib-athar commented 1 year ago

Oh, alright. Thanks for the fast reply.

Do you an estimate on when this could possibly be rolled out to production

zoltanbedi commented 1 year ago

I want to have this fixed this week. So if all goes well then next week this could go out.

dnnshssmnn commented 1 year ago

Hi @zoltanbedi, thanks a lot for looking into this issue and tackling it. For updating our BigQuery datasource, we also rely on this being resolved. Can you provide any update so far?

zoltanbedi commented 1 year ago

Let's talk about this because I took a look and it is not as easy as I thought in the first place.

The automatic migration feature that this plugin has works like this. When you change the datasource from the old doitintl bigquery plugin to this one it will copy the query, format and location. This only works for the queries but not for annotations or variable queries.

What do you expect? What should happen? How should this work? @khubaibathar @dnnshssmnn

rd-khubaib-athar commented 1 year ago

Hi @zoltanbedi, The thing you mentioned that is not available in the migration is at least what I need. We have variable queries and we would like to migrate them as well along with the normal queries. (In simple words, the variable queries section is empty after the migration.) The annotations and variable queries should also be migrated automatically to avoid our users to do manual and error-prone work.

dnnshssmnn commented 1 year ago

Thank you for your quick reply @zoltanbedi.

For us, it would be great if that migration feature would work in the same way for a variable query. Meaning: when changing the datasource of the query of the variable to the new bigquery plugin, it should copy the query (and format and location). Currently it just replaces the old query with an empty one.

Since I'm not familiar with the underlying concepts, I can't tell how this should work or if it is possible at all. Do you think it is?

rd-khubaib-athar commented 1 year ago

Hi @zoltanbedi ,

Sorry to ping you again but are there any updates for this feature enhancement. :)

Best,

zoltanbedi commented 1 year ago

Thanks for your input @khubaibathar and @dnnshssmnn. Sorry I was busy with other issues. I'll try to tackle this next week. I think what @dnnshssmnn says should be doable. I'll update this issue once I have something.

zoltanbedi commented 1 year ago

Hi @khubaibathar and @dnnshssmnn.

I took a look at this and this is not easily doable right now. Variable queires are not the same as the normal data queries. For this to work we need more thinking and planning and with that said the people who are responsible for this should do that.

I'll close this issue here and will open a new feature request in the grafana/grafana repository. I can't promise that this will be picked up in the near future though. Your best option is to copy and paste your query to one datasource to another for now.

https://github.com/grafana/grafana/discussions/62690