Commit Graph

143 Commits

Author SHA1 Message Date
Gábor Farkas
c412a3b052
logs: track the usage of certain features (#50325)
* logs: track the usage of certain features

* Add report interaction for logs interactions

* mock reportInteraction in test

* mock reportInteraction

Co-authored-by: Ivana Huckova <ivana.huckova@gmail.com>
2022-06-09 15:53:23 +02:00
Gábor Farkas
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
renovate[bot]
d4d2a747d0
Update dependency lru-cache to v7.10.1 (#49096)
* Update dependency lru-cache to v7.10.1

* update snapshot

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2022-05-18 10:00:46 +01:00
Ashley Harrison
06d3c27bc1
Select: Portal menu by default (#48176)
* Remove menuShouldPortal from all <Select /> components

* fix unit tests

* leave menuShouldPortal as an escape hatch

* Fix import order
2022-05-04 15:12:59 +01:00
renovate[bot]
00dbea91ea
Update dependency lru-cache to v7.9.0 (#47480)
* Update dependency lru-cache to v7.9.0

* update snapshot

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2022-05-04 15:07:27 +01:00
Alexander Kubyshkin
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
Josh Hunt
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
Ashley Harrison
d832bde270
Upgrade @testing-library/user-event to v14 (#47898)
* Update dependency @testing-library/user-event to v14

* everything is async...

* everything is async pt.2

* Fix cascader tests

* hack the yarn.lock file to remove the old version of @testing-library/dom

* some more fixes!

* MOAR FIXES

* more fixes

* remove a bunch of places where we're wrapping in act()

* down to 7 failing tests...

* Fix arrow tests

* Fix rest of NavBarItem tests

* Fix last tests

* Use {Enter} instead of {enter}

* Revert "Use {Enter} instead of {enter}"

This reverts commit e72453bb52.

* remove some unused act imports

* Fix LibraryPanelsSearch tests

* more stable test

* More consistent test...

Co-authored-by: Renovate Bot <bot@renovateapp.com>
2022-04-21 13:15:21 +01:00
Ivana Huckova
554492ec4e
Loki: Add parsing of query to visual query (#46700)
* Create parser

* Add parsing

* Update comment

* Remove operations that we don't support

* Resolve type errors

* Update test

* Handle backticks

* Handle backticks

* Remove copied test, update test

* Parsing for binary operations

* Remove error about setting state after unmount

Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
2022-03-31 10:51:49 +02:00
Torkel Ödegaard
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
Torkel Ödegaard
1c648cb52c
Loki: Adds options to the new query builder (#46783)
* Initial commit for loki builder options

* Loki query options

* Added some basic tests

* Update public/app/plugins/datasource/loki/querybuilder/components/LokiQueryBuilderOptions.test.tsx

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

* Updated options

* All option changes should trigger query

* Fixed ts issue

Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
2022-03-25 13:13:55 +01:00
renovate[bot]
644e7e7c19
Update dependency lru-cache to v7.7.1 (#46675)
* Update dependency lru-cache to v7.7.1

* update snapshot

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
2022-03-18 11:30:15 +00:00
Ryan McKinley
796bc27f75
Loki: support live streaming (#42804) 2022-03-01 14:46:52 -08:00
renovate[bot]
ce4bba888c
Update dependency lru-cache to v7.4.0 (#45739)
* Update dependency lru-cache to v7.4.0

* Update snapshot

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2022-02-23 16:24:49 +01:00
renovate[bot]
f6780d8861
Update dependency lru-cache to v7 (#45074)
* Update dependency lru-cache to v7

* Make latest lru cache work

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2022-02-18 10:23:06 +01:00
Ivana Huckova
e7a0e69153
Loki: Use explore query field unless new query builder feature toggle is enabled (#44858)
* Loki: Fix using of Explore editor in Explore

* Add test and remove Explore fields in module

* Update tests
2022-02-04 12:19:18 +01:00
Ivana Huckova
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
renovate[bot]
d87cd6f26c
Update dependency prettier to v2.5.1 (#43473)
* Update dependency prettier to v2.5.1

* prettier fixes

* chore(toolkit): bump prettier to 2.5.1

* style(eslint): bump grafana config to 2.5.2 in core and toolkit

* style(mssql-datasource): fix no-inferrable-types eslint errors

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
2022-02-02 12:02:32 +00:00
Torkel Ödegaard
64e1e91403
PromQueryBuilder: Query builder and components that can be shared with a loki query builder and others (#42854) 2022-01-31 06:57:14 +00:00
Ryan McKinley
546818819b
Loki: use queryType rather than range|instant flags (#43727) 2022-01-07 10:00:11 -08:00
Ivana Huckova
698f452e0d
A11y: Add missing aria labels in Loki QueryEditor (#42664)
* Loki: Add missing aria-label

* Update text

* Update text
2021-12-03 14:14:51 +01:00
Devin Smith
8869df2ffe
Loki/Prometheus: Improve facetting message in label browser (#40998)
* Chore: Improve Loki/Prometheus facetting message in label browser

* Chore: Remove uneeded console log and comment
2021-10-28 16:19:54 +02:00
Piotr Jamróz
6dc21d5899
Refactor: Decouple Label Browser from LocalStorage (#40449)
* Refactor: Decouple Label Browser from LocalStorage

* Clean up
2021-10-15 14:18:11 +02:00
Giordano Ricci
f79173c99d
Explore: Reuse Dashboard's QueryRows component (#38942)
* WIP

* Functional without custom wrapper component, needs highlight

* Remove latency from explore

* Sync eventbus

* Some cleanup & removal of unused code

* Avoid clearing queries when running all empty queries

* Run remaining queries when removing one

* Update snapshots

* fix failing tests

* type cleanup

* Refactor QueryRows

* update snapshot

* Remove highlighter expressions

* minor fixes in queryrows

* remove unwanted change

* fix failing e2e test

* Persist refId in explore url state

* make traces test slightly more robust

* add test for query duplication
2021-09-15 16:26:23 +01:00
Olof Bourghardt
d26f3cdd03
Loki: add support for resolution (#36710)
* Add input to specify min step

* Add stepInterval to as input to component

* Add onBlur to Input component

* Loki: add functionality for min step

* Loki: change name on props to step to make it more clear

* Loki: add resolution as a query option

* Loki: Add min,max,exact as step options

* Loki: add functionality for different step modes

* Loki: fix bug where step function isn't working

* Loki: fix bug where exact step isn't working

* Loki: change width of step input field

* Loki: add tests for adjustInterval function

* Loki: add check for max step oprio to make sure it's not below the safe interval

* Loki: fix bug with some tests

* Loki: fix bug with tests

* Explore: add tooltip to loki step function

* Loki: remove resolution as a logs option

* Loki: update snapshots

* Fix failing tests

* Loki: add select component for choosing resolution

* Loki: add functionality for calculating correct interval with resolution applied

* Loki: remove functionality for step mode

* Loki: remove tests for step mode

* Loki: add tooltip to line limit and resolution

* Loki: add backend support for resolution

* Loki: fixed backend bug where resolution was undefined

* Loki: add check for resolution
2021-08-16 14:02:13 +02:00
Ivana Huckova
4cf097c4e5
Small UX updates (#37694) 2021-08-11 09:56:23 +02:00
Ivana Huckova
a0f94866b4
Update dashboard loki query editor (#37541) 2021-08-04 16:23:16 +02:00
Ivana Huckova
7fd94e69c3
Loki: Update labels in log browser when time range changes (#37520)
* Refresh label when time range changes

* Refactor solution

* Add tests

* Update tests comments

* Update test

* Update public/app/plugins/datasource/loki/components/LokiQueryField.tsx

* Update public/app/plugins/datasource/loki/components/LokiQueryField.tsx
2021-08-04 14:37:19 +02:00
Connor Lindsey
b644ea9e6e
Loki: Add fuzzy search to label browser (#36864) 2021-07-26 08:04:03 -06:00
Ashley Harrison
75ff031789
Chore: Fix TypeScript strict errors with components using connect (#37109)
* Chore: Fix TypeScript strict errors with components using connect

* Chore: More TypeScript fixes

* Chore: Update strict check values

* Still need to export these types...

* Declare connector at the top of the file

* Careful with find and replace...
2021-07-23 11:33:26 +02:00
Ashley Harrison
3004a650b5
Chore: Fix more TypeScript strict errors (#37066)
* Chore: Fix more TypeScript strict errors

* whoops
2021-07-22 08:09:55 +01:00
Betula-L
7ef8136e16
Loki: Refactor label browser from GrafanaTheme to GrafanaTheme2 (#35569) 2021-06-15 17:08:13 +02:00
kay delaney
0f81703c35
Chore: Fix more strict typescript errors (#35514) 2021-06-14 15:13:48 +01:00
Marcus Andersson
8ddf6de6e7
Alerting: app specific query editors for Loki and Prometheus (#34365)
* Adding simplified version of query editor based on app flag.

* cleaned up the absolute time range.

* changing placeholder text.

* updated snapshot.

* added some tests.

* adding loki query editor tests.

* updating snapshots.
2021-05-19 16:24:27 +02:00
David
0683692509
Loki/Prometheus: Improve label browser performance (#34244)
* Loki/Prometheus: Improve label browser performance

- raise limits
- introduce debounce for Metrics browser filter fields (not done for Loki)
- discard facetting responses when selector was already changed again by user

* Clean up comments and imports
2021-05-18 18:57:38 +02:00
David
d30efb4651
Split label browser tests to prevent flaky tests (#34238) 2021-05-18 17:44:12 +02:00
David
4b0b69292e
Prometheus: Metrics browser (#33847)
* [WIP] Metrics browser

* Removed unused import

* Metrics selection logic

* Remove redundant tests

All data is fetched now regardless to the current range so test for checking reloading the data on the range change are no longer relevant.

* Remove commented out code blocks

* Add issue number to todos

Co-authored-by: Piotr Jamróz <pm.jamroz@gmail.com>
2021-05-12 11:49:20 +02:00
Zoltán Bedi
46abef7800
Loki: fix label browser crashing when + typed (#33900) 2021-05-11 10:06:40 +02:00
David
59c754823f
Tempo: Search for Traces by querying Loki directly from Tempo (#33308)
* Loki query from Tempo UI

- add query type selector to tempo
- introduce linkedDatasource concept that runs queries on behalf of another datasource
- Tempo uses Loki's query field and Loki's derived fields to find a trace matcher
- Tempo uses the trace-to-logs mechanism to determine which dataource is linked

Loki data loads successfully via tempo

Extracted result transformers

Skip null values

Show trace on list id click

Query type selector

Use linked field trace regexp

* Review feedback
2021-05-10 17:12:19 +02:00
Torkel Ödegaard
7ee994f843
Theme: Renames new theme model from GrafanaThemeV2 to just GrafanaTheme (#33619) 2021-05-03 09:45:54 +02:00
Alex Khomenko
6d95f2f1db
Chore: Update typescript to v4.2.4 (#33297)
* Update typescript to v4.2.4

* Update @types/slate

* Fix QueryVariableEditor.test.tsx

* Fix search-related type errors

* Fix Plugin pages type errors

* Fix missing initializer errors

* Update snapshot

* Revert tsconfig changes
2021-04-28 15:40:01 +03:00
Torkel Ödegaard
e6a9654d0e
Checkbox: Updates to look and feel and using new theme (#33310)
* Checkbox: Updates to look and feel and using new theme

* A few more theme fixes

* Removed comments

* Updated snapshot
2021-04-23 14:40:06 +02:00
Ivana Huckova
c32c682f81
Loki: Refactor query editor so query field can be used independently (#33276)
* Refactor Loki so LokiQueryField can be used independently

* Refactor PromQueryEditor
2021-04-23 10:08:23 +02:00
kay delaney
bad048b7ba
Performance: Standardize lodash imports to use destructured members (#33040)
* Performance: Standardize lodash imports to use destructured members
Changes lodash imports of the form `import x from 'lodash/x'` to
`import { x } from 'lodash'` to reduce bundle size.

* Remove unnecessary _ import from Graph component

* Enforce lodash import style

* Fix remaining lodash imports
2021-04-21 09:38:00 +02:00
Torkel Ödegaard
10badea19e
Emotion: Upgrades emotion from 10 to 11 and updates all import paths (#32541)
* Babel: Updates babel dependencies to latest version

* Emotion: Upgrade form 10 to 11

* Fixing tests

* Updated to use emotion/css instead in test
2021-04-01 14:15:23 +02:00
Ivana Huckova
a127e09503
Loki: Fix text search in Label browser (#32293)
* Switch to simple search before implementing proper fuzzy search

* Just do simple search

* Finalize simple search

* Pass string to highlights
2021-03-25 09:57:08 +01:00
Ivana Huckova
dfd4eccc7c
Loki: Label browser UI updates (#31737)
* UI updates for Label Browser

* Revert "UI updates for Label Browser"

This reverts commit 3d34112762.

* UI updates for Label Browser

* Remove unused style
2021-03-18 16:28:02 +01:00
Ivana Huckova
91dde5c980
Loki: Fix type errors in language_provider (#31902)
* Add initial stat for logLabelOptions

* Refactor, update, remove

* Simplify
2021-03-12 15:21:30 +01:00
Ivana Huckova
53ba6456d4
Loki, Prometheus: Change the placement for query type explanation (#31784)
* Fix tooltip in the way

* Add more info for instant query

* Update public/app/plugins/datasource/loki/components/LokiOptionFields.tsx

* Update public/app/plugins/datasource/prometheus/components/PromExploreExtraField.tsx
2021-03-09 14:17:04 +01:00
David
091e3cf4f8
Loki: Label browser (#30351)
* Loki: Label browser

- replaces stream cascader widget which made it hard to find relevant streams
- multi-step selection allows for selecting a couple of labels first, then find the relevant values
- supports facetting which makes impossible label combinations hard to choose

* Remove unused label hook

* Remove unused label styles

* Use global time range for metadata requests

* Preselect labels if not many exist

* Status and error messages

* Status fixes

* Remove unused import

* Added logs rate button

* Close popup when clicked outside (not working for timepicker :( )

* Change button label

* Get rid of popup and render browser inline

* Review feedback

* Wrap label values and prevent empty lists

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2021-03-02 16:58:14 +01:00