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

Expose Datasource Default Macros to Query Editor #205

Open
baxterjo opened this issue Nov 17, 2022 · 2 comments
Open

Expose Datasource Default Macros to Query Editor #205

baxterjo opened this issue Nov 17, 2022 · 2 comments
Labels
type/feature-request New feature or request

Comments

@baxterjo
Copy link

Discussed in https://github.com/grafana/timestream-datasource/discussions/204

Originally posted by baxterjo November 17, 2022

Problem

The title of this issue alludes to my proposed solution a bit. But I would like to provide the "why" here incase anyone has a better idea of how to implement what I am trying to do.

I currently have several, identical data sources across a few AWS accounts. The names of the databases and tables in these accounts are created by an application stack deployment process and are not identical, but the data in the tables are identical. In my existing Grafana instance, I have one dashboard per data source and all of the dashboards are identical as well. The problem is that when I make a change to one dashboard, I then have to go through and make that change to all dashboards.

What I have Tried

I tried making the data source a variable in the dashboard, but the macros associated with $__table and $__database in the datasource are overwritten on the left side of the query editor when editing a panel. So when I swap the data source on the environment variable dropdown menu, all of the queries break because they are looking for the wrong databases and tables.

Potential Engineering Solution

When writing a query for an Amazon Timestream resource there are three Macro dropdowns on the left side of the query block. I would like to add an explicit use_datasource_default option to those dropdowns to allow for easy switching between datasources on the same dashboard.

OR

Create new macros for the plugin such as $__source_default_database, $__source_default_table, and $__source_default_measure

@tomikpik
Copy link

+1 for this

@Travis-Spidertracks
Copy link

+1 for this - this actually seemed to work on older versions of the plugin where the $__database variable would update based on the datasource for the panel (which could be set by a variable on the dashboard) but now doesn't work, and significantly reduces the usefulness

@fridgepoet fridgepoet added the type/feature-request New feature or request label Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature-request New feature or request
Projects
Status: Backlog
Development

No branches or pull requests

4 participants