Commit Graph

10 Commits

Author SHA1 Message Date
Sven Grossmann
13dd821961
Loki: Fix wrong query expression with inline comments (#70947)
fix remove comments from query
2023-06-30 11:35:43 +02:00
Matias Chomicki
4c4bd69eb6
Logs: Add toggle behavior support for "filter for" and "filter out" label within Logs Details (#70091)
* Datasource test: fix describe nesting

* Parsing: export handleQuotes function

* Modify query: add functions to detect the presence of a label and remove it

* Loki: add support to toggle filters if already present

* Datasource test: fix describe nesting

* Loki: add support to toggle filter out if present

* Remove label: handle escaped values

* Datasource: add test case for escaped label values

* Loki: remove = filter when applying !=

* Remove selector: add support for Selector node being far from Matcher

* Modify query: add unit tests

* Elasticsearch: create modifyQuery for elastic

* Elastic modify query: implement functions

* Elasticsearch: implement modifyQuery functions in datasource

* Elasticsearch: update datasource test

* Loki modify query: check for streamSelectorPositions length

* Elasticsearch query has filter: escape filter value in regex

* Remove unused type

* Modify query: use query modeller instance from module
2023-06-26 16:45:33 +02:00
Sven Grossmann
d7337e4f9c
Loki: Preserve pipeline stages in context query (#70472)
* add pipeline stages to context query

* add ui

* improve `Postion`

* add `processPipelineStagesToExpr` to logcontextprovider

* add ui toggle

* fix lokicontextui tests

* remove import

* contextually hide the toggle

* Update `SHOULD_INCLUDE_PIPELINE_OPERATIONS` name

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

* add setIncludePipelineOperations to false in revert

* add prepareExpression method

* remove unused method

* fix test and add `runContextQuery`

* set correct revert state

* let let be const

* remove argument

---------

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
2023-06-22 17:34:43 +02:00
Ivana Huckova
2509dec0cb
Loki: Fix ad hoc filters when used with number and > and < operators (#66579)
Loki: Fix ad hoc filters when used with number and >< operators
2023-04-17 10:27:38 +02:00
Ivana Huckova
8bda8b8272
Log volume: Fix functionality if query has multiple comments (#61306)
* Log volume: Fix functionality if query has comments

* Add additional test
2023-01-11 16:21:02 +00:00
Sven Grossmann
932349b5ab
Loki: Fix wrongly escaped label values when using LabelFilter (#59812)
* change backticks to quotes

* add unescaping to `addFilterAsLabelFilter`

* fix removal of wrong quotes

* change unescape order
2022-12-06 12:30:03 +01:00
Ivana Huckova
28c390bc90
Loki: Fix adhoc parsing if multiple stream selectors and some empty (#58658) 2022-11-25 14:00:48 +01:00
Ivana Huckova
7928f170ce
Loki: Fix adding of adhoc filters to stream selector when query with empty stream selector (#57280)
* disable double stringify

* Refactor test for addLabelToQuery

* Add tests (TDD for expected behaviour)

* Fix adding ad hoc filters to correct place when no stream selector

* Update

* Update comment

* Fix getAllPositionsInNodeByType

Co-authored-by: Sven Grossmann <svennergr@gmail.com>
2022-10-19 17:24:00 +02:00
renovate[bot]
4c8ea0bb89
Update dependency @lezer/common to v1 (#50866)
* Update dependency @lezer/common to v1

* Bump lezer/lr as well

* Fix broken code

* Add new lezer-promql and update lezer-logql

* Change to prometheus lezer-promql, fix lezer-logql code

* Update tests for Loki

* fix typeErrors

* fix tests by adding new error node to expected objects

* refactor usages of node references to differentiate usage from node object

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
Co-authored-by: Ivana Huckova <ivana.huckova@gmail.com>
Co-authored-by: gtk-grafana <galen.kistler@grafana.com>
2022-08-22 08:45:29 -05:00
Ivana Huckova
bf3fa4a445
Loki: Fix producing correct log volume query for query with comments (#53254)
* Loki: Remove comments from log volume query

* Update, add more tests

* Update based on suggestions

* Update

* Update tests to use it.each
2022-08-04 17:58:39 +02:00