grafana/public/app/plugins/datasource/loki
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
configuration Loki/Elasticsearch config: Add DataSourceDescription component (#71206) 2023-07-07 14:22:52 +01:00
img loki: updates the logo 2018-12-12 20:34:33 +01:00
migrations Loki: Fix including of template variables in variable query editor (#69698) 2023-06-07 15:38:45 +02:00
querybuilder Loki: Add the ability to prettify logql queries (#64337) 2023-07-21 13:03:56 +01:00
backendResultTransformer.test.ts FieldValues: Use plain arrays instead of Vector (part 3 of 2) (#66612) 2023-04-20 17:59:18 +03:00
backendResultTransformer.ts Loki: Rename public/app/plugins/datasource/loki/query_utils.ts file to follow convention (#55180) 2022-09-16 10:16:54 +02:00
dataquery.cue Chore: Remove pfs.GrafanaPlugin from schemas (#71884) 2023-07-19 03:46:13 -04:00
dataquery.gen.ts Chore: Generate plugin version and remove lineage version (#69781) 2023-06-27 12:47:14 +03:00
datasource.test.ts Loki: Use better query validation before requesting stats (#70800) 2023-06-29 16:50:17 +01:00
datasource.ts logs: refactor: move logsModel to the logs folder (#70989) 2023-07-04 13:27:52 +02:00
getDerivedFields.test.ts DataFrame: Deprecate MutableDataFrame (#67569) 2023-05-01 19:41:40 -07:00
getDerivedFields.ts FieldValues: Use standard array functions (#67012) 2023-04-20 22:03:38 -07:00
language_utils.test.ts Loki: query editor using Monaco (#55391) 2022-10-06 10:35:30 -04:00
LanguageProvider.test.ts Loki: Add unpack query builder hint (#65608) 2023-03-30 15:18:02 +02:00
LanguageProvider.ts Update dependency lru-cache to v10 (#71585) 2023-07-14 10:26:58 +01:00
languageUtils.test.ts Loki: Fix wrongly escaped label values when using LabelFilter (#59812) 2022-12-06 12:30:03 +01:00
languageUtils.ts Loki: Fix wrongly escaped label values when using LabelFilter (#59812) 2022-12-06 12:30:03 +01:00
lineParser.test.ts Loki: Add unpack query builder hint (#65608) 2023-03-30 15:18:02 +02:00
lineParser.ts Loki: Add unpack query builder hint (#65608) 2023-03-30 15:18:02 +02:00
LiveStreams.test.ts Logs: Fix unresponsive log lines if duplicate ids in Elasticsearch (#68569) 2023-05-17 16:28:25 +03:00
LiveStreams.ts Loki: Rename public/app/plugins/datasource/loki/live_streams.ts file to follow convention (#55148) 2022-09-14 14:55:15 +02:00
liveStreamsResultTransformer.test.ts Logs: Fix unresponsive log lines if duplicate ids in Elasticsearch (#68569) 2023-05-17 16:28:25 +03:00
liveStreamsResultTransformer.ts Logs: Fix unresponsive log lines if duplicate ids in Elasticsearch (#68569) 2023-05-17 16:28:25 +03:00
LogContextProvider.test.ts Loki: Preserve pipeline stages in context query (#70472) 2023-06-22 17:34:43 +02:00
LogContextProvider.ts Logs: Implement "infinite" scrolling in log context (#69459) 2023-06-28 11:51:16 +03:00
logsTimeSplitting.test.ts Loki Query Splitting: Rename from "chunk" to "splitting" (#65630) 2023-04-03 12:30:08 +00:00
logsTimeSplitting.ts Loki Query Splitting: Rename from "chunk" to "splitting" (#65630) 2023-04-03 12:30:08 +00:00
makeTableFrames.test.ts FieldValues: Use plain arrays instead of Vector (part 3 of 2) (#66612) 2023-04-20 17:59:18 +03:00
makeTableFrames.ts FieldValues: Use plain arrays instead of Vector (part 3 of 2) (#66612) 2023-04-20 17:59:18 +03:00
metricTimeSplitting.test.ts Loki Query Splitting: Rename from "chunk" to "splitting" (#65630) 2023-04-03 12:30:08 +00:00
metricTimeSplitting.ts Loki Query Splitting: Rename from "chunk" to "splitting" (#65630) 2023-04-03 12:30:08 +00:00
mocks.ts FieldValues: Use plain arrays instead of Vector (part 3 of 2) (#66612) 2023-04-20 17:59:18 +03:00
modifyQuery.test.ts Loki: Fix wrong query expression with inline comments (#70947) 2023-06-30 11:35:43 +02:00
modifyQuery.ts Loki: Fix wrong query expression with inline comments (#70947) 2023-06-30 11:35:43 +02:00
module.test.ts Loki: Fix tracking of queries_with_changed_line_limit_count (#60091) 2023-01-09 09:54:57 +01:00
module.ts Loki: Add tracking for on dashboard load (#59914) 2022-12-06 21:15:55 +01:00
plugin.json Plugins: Set backend metadata property for core plugins (#43349) 2021-12-22 17:59:26 +01:00
queryHints.test.ts FieldValues: Use plain arrays instead of Vector (part 3 of 2) (#66612) 2023-04-20 17:59:18 +03:00
queryHints.ts Loki: Add unpack query builder hint (#65608) 2023-03-30 15:18:02 +02:00
querySplitting.test.ts Loki: Implement step editor (#69648) 2023-06-16 19:08:29 +03:00
querySplitting.ts Loki: Implement step editor (#69648) 2023-06-16 19:08:29 +03:00
queryUtils.test.ts Loki: Add the ability to prettify logql queries (#64337) 2023-07-21 13:03:56 +01:00
queryUtils.ts Loki: Add the ability to prettify logql queries (#64337) 2023-07-21 13:03:56 +01:00
README.md Prettier: Fix all markdown files and add markdown files to CI verify step (#39776) 2021-09-29 14:34:40 +02:00
responseUtils.test.ts FieldValues: Use plain arrays instead of Vector (part 3 of 2) (#66612) 2023-04-20 17:59:18 +03:00
responseUtils.ts FieldValues: Use plain arrays instead of Vector (part 3 of 2) (#66612) 2023-04-20 17:59:18 +03:00
sortDataFrame.test.ts FieldValues: Use plain arrays instead of Vector (part 3 of 2) (#66612) 2023-04-20 17:59:18 +03:00
sortDataFrame.ts FieldValues: Use plain arrays instead of Vector (part 3 of 2) (#66612) 2023-04-20 17:59:18 +03:00
streaming.ts Chore: ESlint import order (#44959) 2022-04-22 14:33:13 +01:00
syntax.test.ts Explore: Fix vector(5) syntax error in loki log explore (#63994) 2023-03-03 10:09:34 +01:00
syntax.ts Explore: Fix vector(5) syntax error in loki log explore (#63994) 2023-03-03 10:09:34 +01:00
tracking.test.ts Loki: Implement step editor (#69648) 2023-06-16 19:08:29 +03:00
tracking.ts Loki: Add feature tracking to reduce repetition (#69900) 2023-06-12 13:03:47 +02:00
types.ts Loki: Add predefined operations functionality behind feature flag (#69379) 2023-06-02 12:52:36 +02:00
variables.test.ts Loki: add missing interpolation to metric find query requests (#54979) 2022-09-12 17:48:04 +02:00
variables.ts Loki: add missing interpolation to metric find query requests (#54979) 2022-09-12 17:48:04 +02:00

Loki Data Source - Native Plugin

This is a built in data source that allows you to connect to the Loki logging service.