grafana/pkg/services/featuremgmt
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
..
strcase Chore: Upgrade Go to 1.19.1 (#54902) 2022-09-12 12:03:49 +02:00
testdata FeatureFlags: define features outside settings.Cfg (take 3) (#44443) 2022-01-26 09:44:20 -08:00
codeowners.go Plugins: Add feature toggle for Temporary Credentials (#71033) 2023-07-06 17:06:11 +02:00
features.go FeatureFlags: Change alpha/beta language to align with release staging language (#69422) 2023-06-08 09:16:55 -07:00
manager_test.go FeatureFlags: define features outside settings.Cfg (take 3) (#44443) 2022-01-26 09:44:20 -08:00
manager.go Fixing typos (#70487) 2023-06-22 09:43:38 +01:00
registry.go Loki: Add the ability to prettify logql queries (#64337) 2023-07-21 13:03:56 +01:00
service_test.go chore: move models/licensing into licensing service (#61878) 2023-01-23 11:53:43 -05:00
service.go FeatureFlags: Change alpha/beta language to align with release staging language (#69422) 2023-06-08 09:16:55 -07:00
settings_test.go FeatureFlags: define features outside settings.Cfg (take 3) (#44443) 2022-01-26 09:44:20 -08:00
settings.go Chore: Replace yaml.v2 with yaml.v3 (#59897) 2022-12-06 21:17:17 +01:00
toggles_gen_test.go FeatureFlags: Change alpha/beta language to align with release staging language (#69422) 2023-06-08 09:16:55 -07:00
toggles_gen.csv Loki: Add the ability to prettify logql queries (#64337) 2023-07-21 13:03:56 +01:00
toggles_gen.go Loki: Add the ability to prettify logql queries (#64337) 2023-07-21 13:03:56 +01:00
usage_stats_test.go Previews: remove dashboard previews backend (#66176) 2023-04-13 21:42:24 +04:00
usage_stats.go UsageStats: track enabled features (#47407) 2022-04-08 12:42:33 +02:00