Commit Graph

4 Commits

Author SHA1 Message Date
Alex Spencer 31fc7d5d7a
SQL Expressions: LLM plugin integration - SQL suggestions and SQL explanations (#107545)
* init: first pass at AI generated SQL expressions

* chore: fixes to tests

* i18n

* chore: small GenAIButton style update

* lazy load the genAI button - circular dependency issue in our test mocks...?

* chore: polish

* fix: i18n

* feat: make it a whole lot more capable

* chore: extract prompt logic to common file

* chore: consolidate state management to custom hooks

* chore: clean up, update GenAIButton API, etc.

* chore: major sql prompt improvement + plan for future + genAIButton api update

* chore: polish for now

* chore: clean up folder structure

* chore: conditionally use hooks + improve prompt

* chore: betterer....

* chore: polish

* feat: testing 🚀

* chore: polish polish polish

* chore: remove startWithPrompt

* chore: timeout 30

* chore: add experimental badge

* i18n + 60 sec timeout

* chore: MOAR POLISH

* chore: clean up explanation drawer

* chore: update tests

* chore: update FF checks

* chore: get the rendering w/FF correct

* chore: fix tests

* chore: re-work ai tooltips

* chore: cleanup

* chore: handle sql button styling differently

* chore: fix styling last time
2025-08-13 09:24:04 -07:00
Kristina 5bfed408ed
SQL Expressions: Enable Auto-complete (#106511)
* First draft autocomplete

* Better naming

* Change suggestion to table/column population

* Remove all suggestions, just use table/column population but trigger on space

* Gate feature flag behind a feature flag

* Reorganize and add function list

* Add blurb about autocomplete to docs

* Update public/app/features/expressions/utils/metaSqlExpr.ts

Co-authored-by: Alex Spencer <52186778+alexjonspencer1@users.noreply.github.com>

* Add try catch, remove promise resolve

---------

Co-authored-by: Alex Spencer <52186778+alexjonspencer1@users.noreply.github.com>
2025-07-23 16:49:58 -05:00
Kyle Brandt c6e52c4766
SQL Expressions: Make SQL Expressions work with Alerting (#101820)
Initial support for alerting with SQL expressions

- When `format` is set to `alerting`, SQL expressions output in a format suitable for alerting evaluation.
- Outstanding TODOs:
  - Deduplicate output rows
  - Add more tests
  - Fix broken alerting UI rendering (likely due to shape change to undocumented full-long format)
- Basic usage:
  - SQL must return one numeric column and one or more string columns.
  - Each row may become an alert.
  - The alert fires if the numeric value is non-zero.
  - String columns are treated as labels.

---------

Co-authored-by: Konrad Lalik <konradlalik@gmail.com>
Co-authored-by: Tom Ratcliffe <tom.ratcliffe@grafana.com>
Co-authored-by: Sam Jewell <sam.jewell@grafana.com>
2025-04-02 09:39:36 -04:00
Sam Jewell cd30742616
SQL Expressions: Mount front-end component right first time (#103087)
* Call onChange method once on render so we have access to the value on init

---------

Co-authored-by: Tom Ratcliffe <tom.ratcliffe@grafana.com>
2025-04-01 11:49:39 -04:00