grafana / athena-datasource

Apache License 2.0
37 stars 12 forks source link

inject a comment into queries so that the panel/dashboard can be easily identified #281

Open fridgepoet opened 11 months ago

fridgepoet commented 11 months ago

Migrated from a discussion

Originally posted by **antonysouthworth-halter** September 20, 2023 hope the title makes sense, what I am thinking is when the user provides a query like ``` select sum(some_metric), date_trunc('hour', utc_timestamp) from my_table where utc_timestamp between $__timeFrom and $__timeTo ``` the plugin should _actually_ send a query that looks like ``` -- Athena Grafana Plugin: my-dashoard, my-panel select sum(some_metric), date_trunc('hour', utc_timestamp) from my_table where utc_timestamp between $__timeFrom and $__timeTo ``` The use-case for this is understanding usage of Athena from within our Grafana instance, e.g. if I see a really slow query in the "Recent queries" panel in the AWS console, at the moment they only way to figure out which panel is issuing the query is to ask in Slack "hey, does anyone recognise this?" Having the information recorded directly in the query text would be very helpful in this case.
GautamGottipati commented 11 months ago

@fridgepoet looks like the discussion link is not found. I am interested in taking up this issue.

fridgepoet commented 11 months ago

@GautamGottipati Sorry about that. I've just checked and there were no more replies to that discussion. Everything on the original proposal is in this issue.

I am interested in taking up this issue.

Great, feel free to go for it! I think it will be helpful first to describe in just words how you plan to implement the idea so we can agree on it, if that sounds good to you? Also feel free to break up the work and make multiple PRs!