179 Commits

Author SHA1 Message Date
445e1b3eae Loki: add missing interpolation to metric find query requests (#54979)
* feat(loki-variable-query-support): refactor datasource to support legacy and new variable query format

* Chore: fix comment

* Chore: use internal method to interpolate strings

* Chore: revert removed changes

* Chore: update test
2022-09-12 17:48:04 +02:00
20b07fae6f fix bug in loki's adhoc filters (#54920) 2022-09-09 12:04:51 +02:00
e9243f8a38 Loki: Rename public/app/plugins/datasource/loki/language_provider.ts file to follow convention (#54819) 2022-09-08 14:32:32 +02:00
6e6069a2ba Loki: Create Variable Query Editor for Loki. (#54102)
* feat(loki-query-editor): create base editor component

* feat(loki-query-editor): update editor to use loki query type

* feat(loki-query-editor): add custom variable support to datasource

* feat(loki-query-editor): prevent errors when no label is present

* Add unit test for LokiMetricFindQuery

* Update datasource test

* Add component test

* Add variable query migration support

* feat(loki-query-editor): add migration support for older-format variables

* Fix enum capitalization for consistency

* Move attribute to the top of the class

* Remove unnecessary from()

* Update capitalization of new enum

* Fix enum capitalization in component

* feat(loki-query-editor): replace unnecessary class with class method
2022-08-30 18:18:51 +02:00
fecf4c41ad Dashboard: Spelling corrections in end-user visible dialogs (#53340) 2022-08-09 10:19:30 +02:00
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
a51d3dad4f Loki: support template variables when running stream (live) mode (#52973) 2022-07-29 08:41:11 -07:00
772b6396f5 Loki: Add hints for level-like labels (#52414)
* Loki: Add hint for level-like label

* Add test to addToQuery

* Add tests

* Update tests

* Update copy

* Get log position in metrics query and add test

* Update
2022-07-22 16:59:25 +02:00
6cab909132 Loki: Fix show context not working in some occasions (#52458)
* added missing `languageProvider.start` call

* moved `languageProvider.start`
2022-07-20 12:28:11 +02:00
8ff152f98f ModifyQuery: Improve typing for modifyQuery and query hints (#52326)
* ModifyQuery: Improve typing

* Elasticsearch: Added `modifyQuery` method to add filters in Explore (#52313)

* fixed elasticsearch `QueryFixAction` type

Co-authored-by: Sven Grossmann <Svennergr@gmail.com>
2022-07-18 14:13:34 +02:00
1d077e84ce Loki: Add hint for pipeline error to query builder (#52134)
* WIP

* Update

* Add tests

* Fix lint/betterer errors

* Update public/app/plugins/datasource/loki/addToQuery.ts

* Update copy
2022-07-14 10:48:27 +02:00
10cb84e401 Loki: Implement hints for query builder (#51795)
* Loki: Implement hints for query builder

* Update name of file

* Update imports

* Refactor

* Remove unused import

* Unify

* Revert "Unify"

This reverts commit 78da0e27e33d878b3763a6aca004059b0330c3f0.

* Unify

* Fix types

* Fix tests

* Fix type error

* Simplify

* Update test

* Add documentation

* Update comment

* Add tests for addParserToQuery

* Smaller updates
2022-07-07 15:49:31 +02:00
39bd3e2fe3 rename logs_model.ts->logsModel.ts; update references (#51468) 2022-06-29 21:04:30 +02:00
d3dd3042d6 Loki: Fix support of ad-hoc filters for specific queries (#51232)
* Loki: Refactor ad-hoc filters to use parser

* Remove renaming of files for easier review

* Update

* Update

* Add previously buggy test

* Fix tests

* Fix typos

* Update, improve typing

* Move reused code up

* Update order

* Update betterer statss
2022-06-24 22:29:22 +02:00
48a258f515 loki: no histogram for instant queries (#50711) 2022-06-20 11:31:36 +02:00
50145e1617 Loki: remove frontend mode code (#50185)
* feature-flag removed

* loki: remove frontend-mode
2022-06-08 08:14:34 +02:00
cb96f51c73 Loki: remove angular (#49471)
* loki: remove angular

Co-Authored-By: Joey Tawadrous <joey.tawadrous@grafana.com>

* better backward-compatibility

* slightly better typescript check

Co-authored-by: Joey Tawadrous <joey.tawadrous@grafana.com>
2022-06-07 12:41:16 +02:00
f8eb3c8720 Revert "Loki: do not produce histogram for instant queries (#50019)" (#50182)
This reverts commit b0925ed4ee822645729ddc294d07b0cf54f04346.
2022-06-06 08:57:36 +02:00
6011c373ae loki: handle ad hoc filters in backend mode (#50135)
* loki: handle ad hoc filters in backend mode

* devenv: better loki fake data

* added test
2022-06-03 10:53:03 +02:00
46d6573968 loki: add cookie-handling functionality (#49978) 2022-06-02 11:52:27 +02:00
b0925ed4ee Loki: do not produce histogram for instant queries (#50019)
* loki: no histogram for instant queries

* added test
2022-06-02 09:13:57 +00:00
0caeaaafe3 loki: add back frontend-mode metadata queries (#49297) 2022-05-21 16:46:39 +02:00
93e299305c loki: backend-mode: apply default max-lines if not set in the UI (#48859) 2022-05-21 16:39:21 +02:00
061055fac9 loki: dataframes: do not set field.config.DisplayName (#49317) 2022-05-20 17:27:49 +02:00
0355772e36 loki: do not use backend-mode when keepCookies is used (#49222) 2022-05-19 14:26:54 +02:00
8b9419222a loki: backend-mode: fix experimental stream-mode (#48936) 2022-05-16 08:28:41 +02:00
270e38cfcf loki: backend-mode: handle derived fields (#48873) 2022-05-11 09:29:04 +02:00
60cabaea0a loki: use metadataRequest in testDatasource (#48431) 2022-05-05 09:43:36 +02:00
f00ffb190c Escape backslashes in regexps in Loki label browser (#45809, #47039). (#47412)
* Escape backslashes in regexps in Loki label browser (#45809, #47039).

* Escape values in Loki Query Builder.

* Escape more values in Loki Query Builder.
2022-05-04 12:49:04 +02:00
ae926c2144 loki: better resource-call urls (#48250) 2022-04-28 14:28:57 +02:00
c73b9d1818 Loki: do not use the old labels-api (#48185)
* loki: do not use old labels-api

* adjust allowed-url-list

* fixed tests
2022-04-26 11:51:26 +02:00
d8a754c4a0 loki: send metadata requests through backend (#48063) 2022-04-25 13:16:14 +02:00
3c6e0e8ef8 Chore: ESlint import order (#44959)
* Add and configure eslint-plugin-import

* Fix the lint:ts npm command

* Autofix + prettier all the files

* Manually fix remaining files

* Move jquery code in jest-setup to external file to safely reorder imports

* Resolve issue caused by circular dependencies within Prometheus

* Update .betterer.results

* Fix missing // @ts-ignore

* ignore iconBundle.ts

* Fix missing // @ts-ignore
2022-04-22 14:33:13 +01:00
f2814046d1 loki: logrowcontext: explicitly name fields (#48043) 2022-04-22 08:43:33 +02:00
79c06fdddc Loki: add backend-forward mode to queries, update log-row-context (#47726)
* loki: add helper function to sort dataframe by time

* loki: add direction-attribute to queries

* loki: make log-row-context code backward-compatible

* better comment

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

* fixed test

* simplified code

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
2022-04-20 13:52:15 +02:00
6f31a69bfd QueryEditorRow: Show query errors next to query in a consistent way across Grafana (#47613)
* Show query errors under each query row

* Testing a more plain error box

* Font size

* Make it green

* Nit UI

* Slight simplification of condition

* New design

* Update

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2022-04-14 12:57:56 +02:00
a15c2021fe Loki: improve backend-compatibility (#47579)
* loki: annotation queries: make them ready for the backend-mode

* removed unused code
2022-04-12 18:23:19 +02:00
8db35b9b0b loki: backend-mode: allow for dashboards too (#47578) 2022-04-12 12:16:05 +02:00
eca61e6dd7 loki: removed unused fields, params, attributes (#47571)
* loki: refactor: removed unused param

* loki: removed unused attribute

* loki: removed unused fields

* loki: remove unused query.format

* loki: removed unused prop
2022-04-12 12:09:47 +02:00
68511e7712 loki: use single-dataframe format on the backend (#47069) 2022-04-12 11:58:48 +02:00
9574f447bb grafana-data: removed DataQueryRequest.reverse (#47487) 2022-04-08 12:00:16 +03:00
e1438990ae Loki: use the same dataframe-format for both live and normal queries (#47153)
* loki: use single dataframe-format for both live and normal queries

* better comment

* better function-name

* simplified code

* logs_model: added test
2022-04-08 09:57:06 +02:00
10d8ccc8ff Loki: Return false from isMetricsQuery if query is empty (#47024) 2022-03-29 18:18:43 +02:00
5f9cd7b875 Loki: Add aggregate by label support (#46965)
* Loki: Add aggregate by label support

* Label lookups now work for loki

* Fixed ts issue

* review comment fixed
2022-03-29 17:49:21 +02:00
796bc27f75 Loki: support live streaming (#42804) 2022-03-01 14:46:52 -08:00
1cad35ea67 loki: backend mode: support all query types (#45619)
* loki: backend mode: support all query types

* loki: backend: adjust vector-parsing field-names

* loki: backend: no interval for streams-dataframes

* loki: backend: enable more query types

* better variable name

* removed unnecessary code

* improve frame-processing

* more unit tests

* improved code

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

* remove unused code

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

* simplify code

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

* lint fix

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
2022-02-25 09:14:17 +01:00
a612087c63 loki: remove fullRangeLogsVolume feature flag (#45286) 2022-02-15 09:05:03 +01:00
2c0030b1b4 logs-volume: remove custom timeout (#45041)
* logs-volume: remove custom timeout

* make error message a little better
2022-02-08 15:39:09 +01:00
560c773905 loki: run some queries through the backend (#44729) 2022-02-07 08:43:48 +01:00
c23bc1e7b7 Prometheus: Show variable options in query builder (#44784)
* Prometheus: Show variable options

* Remove lint error

* Fix test for CodeQL

* Update public/app/plugins/datasource/prometheus/datasource.ts

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>

* Update public/app/plugins/datasource/loki/datasource.ts

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>

Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
2022-02-03 11:40:19 +01:00