grafana/public/app/plugins/datasource/loki/components
Gareth Dawson 4e42f9b619
Loki: Add the ability to prettify logql queries (#64337)
* pushed to get help of a genius

* fix: error response is not json

* feat: make request on click

* refactor: remove print statement

* refactor: remove unnecessary code

* feat: convert grafana variables to value for API request

* use the parser to interpolate and recover the original query (#64591)

* Prettify query: use the parser to interpolate and recover the original query

* Fix typo

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>

* Fix typo

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>

* fix: reverse transformation not working

---------

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
Co-authored-by: Gareth Dawson <gwdawson.work@gmail.com>

* fix: bugs created from merge

* refactor: move prettify code out of monaco editor

* fix: variables with the same value get converted back to the incorect variable

* refactor

* use consistent styling with bigquery

* fix: only allow text/plain and application/json

* fix: only make the request if the query is valid

* endpoint now returns application/json

* prettify from js

* WIP: not all cases are handles, code still needs cleaning up

* WIP

* large refactor, finished support for all pipeline expressions

* add tests for all format functions

* idk why these files changed

* add support for range aggregation expr & refactor

* add support for vector aggregation expressions

* add support for bin op expression

* add support for literal and vector expressions

* add tests and fix some bugs

* add support for distinct and decolorize

* feat: update variable replace and return

* fix: lezer throws an errow when using a range variable

* remove api implementation

* remove api implementation

* remove type assertions

* add feature flag

* update naming

* fix: bug incorrectly formatting unwrap with labelfilter

* support label replace expr

* remove duplicate code (after migration)

* add more tests

* validate query before formatting

* move tests to lezer repo

* add feature tracking

* populate feature tracking with some data

* upgrade lezer version to 0.1.7

* bump lezer to 0.1.8

* add tests

---------

Co-authored-by: Matias Chomicki <matyax@gmail.com>
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
2023-07-21 13:03:56 +01:00
..
monaco-query-field Chore: Upgrade prettier to v3 (#71764) 2023-07-17 15:58:22 +01:00
AnnotationsQueryEditor.tsx Loki Query Editor: Make Monaco the default editor (#62247) 2023-02-06 11:18:01 +01:00
LokiCheatSheet.tsx Accessibility: Make QueryEditorHelp examples keyboard interactive (#59355) 2022-12-05 16:03:24 +01:00
LokiContextUi.test.tsx Loki: Preserve pipeline stages in context query (#70472) 2023-06-22 17:34:43 +02:00
LokiContextUi.tsx Tracing: Show next/prev buttons when span filters are collapsed (#71025) 2023-07-12 07:52:07 +01:00
LokiLabelBrowser.test.tsx Loki: Rename public/app/plugins/datasource/loki/language_provider.ts file to follow convention (#54819) 2022-09-08 14:32:32 +02:00
LokiLabelBrowser.tsx Loki: Update feature tracking for label browser (#59295) 2022-12-12 15:35:29 +00:00
LokiOptionFields.test.tsx Loki: Fix showing of correct line limit in options (#69572) 2023-06-08 14:40:39 +02:00
LokiOptionFields.tsx Loki: Use getNormalizedLokiQuery to get queryType (#70237) 2023-06-20 16:27:32 +02:00
LokiQueryEditor.test.tsx Chore: adjust more unit tests to work with react 18 (#64759) 2023-03-15 10:12:13 +00:00
LokiQueryEditor.tsx Loki: Remove unused datasource prop from LokiQueryBuilderOptions (#69445) 2023-06-02 13:26:20 +02:00
LokiQueryEditorByApp.test.tsx Loki: Improve the display of loki query stats (#63623) 2023-03-16 18:50:42 +00:00
LokiQueryEditorByApp.tsx Loki: Fix the name of exported component from LokiQueryEditor.tsx (#57340) 2022-10-20 14:49:55 +02:00
LokiQueryEditorForAlerting.tsx Loki Query Editor: Make Monaco the default editor (#62247) 2023-02-06 11:18:01 +01:00
LokiQueryField.test.tsx Loki Query Editor: Make Monaco the default editor (#62247) 2023-02-06 11:18:01 +01:00
LokiQueryField.tsx Loki: Add the ability to prettify logql queries (#64337) 2023-07-21 13:03:56 +01:00
stats.test.ts Loki: Use better query validation before requesting stats (#70800) 2023-06-29 16:50:17 +01:00
stats.ts Loki: Use better query validation before requesting stats (#70800) 2023-06-29 16:50:17 +01:00
types.ts Chore: ESlint import order (#44959) 2022-04-22 14:33:13 +01:00
VariableQueryEditor.test.tsx Loki Variable Query Editor: Fix bug when the query is updated (#66509) 2023-04-13 23:30:27 +02:00
VariableQueryEditor.tsx Loki: Make stream selector input in variables editor larger (#69729) 2023-06-07 18:56:35 +03:00