grafana/public/app/plugins/datasource/loki/querybuilder
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
..
components Loki: Add the ability to prettify logql queries (#64337) 2023-07-21 13:03:56 +01:00
binaryScalarOperations.ts Chore: ESlint import order (#44959) 2022-04-22 14:33:13 +01:00
LokiQueryModeller.test.ts Loki: Add support for IP label and line filter in query builder (#52658) 2022-07-25 15:16:04 +02:00
LokiQueryModeller.ts Loki: Add support for range aggregations with by grouping (#56184) 2022-10-05 11:32:33 +02:00
operations.test.ts Loki Monaco Editor: grab operator documentation from the operations module (#57525) 2022-10-26 15:44:44 +02:00
operations.ts Loki: Add support for distinct operation in autocomplete and query builder (#69003) 2023-05-25 14:22:16 +02:00
operationUtils.test.ts Loki: Display error with label filter conflicts (#63109) 2023-02-22 09:56:20 +00:00
operationUtils.ts Loki: Display error with label filter conflicts (#63109) 2023-02-22 09:56:20 +00:00
parsing.test.ts Loki: Fix parsing of escaped quotes in LogQL (#69584) 2023-06-06 11:07:21 +02:00
parsing.ts Logs: Add toggle behavior support for "filter for" and "filter out" label within Logs Details (#70091) 2023-06-26 16:45:33 +02:00
state.test.ts Loki: Fix types in querybuilder state test (#53223) 2022-08-03 15:59:33 +02:00
state.ts Chore: more type fixes (#62952) 2023-02-09 09:03:13 +00:00
types.ts Loki: Add support for distinct operation in autocomplete and query builder (#69003) 2023-05-25 14:22:16 +02:00