Commit Graph

11 Commits

Author SHA1 Message Date
Gábor Farkas
9ca888527b
Logs: Implement "infinite" scrolling in log context (#69459)
* logs: context: allow "infinite" scroll

* Log Context: Add visual changes to infinite scrolling (#70461)

* remove text showing how many log lines are loaded

* better positioning of loading indicators

* add border

* fix import

* better loading states

* improve corner cases

* increase page size 10 => 50

* updated unit test, simplified code

* fixed tests

* updated tests

* removed unused code

* fixed test

* improved refid-handling in loki

* removed unnecessary code

* better variable name

* refactor

* refactor

---------

Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
2023-06-28 11:51:16 +03: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
3e46720a96
Loki: Fix creating correct context query when preserved labels used (#69252) 2023-05-30 17:12:40 +02:00
Ivana Huckova
67ca91ece3
Loki: Fix incorrect evaluation of real and extracted labels in context (#67112)
* Loki: Fix incorrect evaluation of real/extracted labels in context

* Add tests

* Improve caching and add more tests

* Use mockResolvedValue

* Flip logic for getInitContextFiltersFromLabels

* Update to logic to use fetchSeriesLabels for queries with more than 1 parser
2023-04-24 17:36:30 +02:00
Leon Sorokin
b24ba7b7ae
FieldValues: Use plain arrays instead of Vector (part 3 of 2) (#66612)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2023-04-20 17:59:18 +03:00
Sven Grossmann
1e53a87d76
Log Context: Add button to open the context query in a split view (#66777)
* add show context button

* improve type definition

* change to default `maxLines`

* remove context query

* add provider to tests

* add test for split view button

* improve documentation

* add tests for `getLogRowContextQuery`

* refactor LogsContainer functions

* fix spelling

* add `contextQuery` as state

* fix tests

* fix lint

* do not use callIfDefined

* make button secondary
2023-04-20 14:21:14 +02:00
Ivana Huckova
f612a72f96
Loki: Update log context UI (#66730)
* fix logrowcontext scrolling behavior

* Loki: Update loki context ui menu

* Update

* Add test, update

* Use escapeLabelValueInSelector when displaying labels

* Update test for new appliedContextFilters

---------

Co-authored-by: Sven Grossmann <svennergr@gmail.com>
2023-04-18 15:59:22 +02:00
Sven Grossmann
a6a7cebbe5
Logs: Redesign and improve LogContext (#65939)
* Logs: Add new LogRowContext types to grafana/data

* use right type for `RowContextOptions`

* add missing renames

* add show context modal

* no need to call

* removed unused css

* sort properties

* rename

* use correct

* use

* add tests for

* wip

* remove add/minus buttons

* add tests

* disable processing of context results in Loki

* moved into table to align properly

* remove imports

* add highlighting of opened logline

* improve scrolling behavior

* correct style for the table

* use correct query direction

* fix text

* use LoadingBar

* use overflow auto

* rename `onToggleContext` to `onOpenContext`

* add missing import

* mock scrollIntoView

* update unused props

* remove unused import

* no need to process context dataframes

* only show `LogRowContextModal` if `getRowContext` is defined

* remove unused param

* use `userEvent` rather `fireEvent`

* change to `TimeZone`

* directly use style classes

* revert change to public_dashboard_service_mock.go

* improved styling

* add missing await in test

* fix lint

* fix lint

* remove LogRow scrolling when context is opened

* remove references to `scrollElement`

* Update public/app/features/logs/components/log-context/LogRowContextModal.tsx

Co-authored-by: Matias Chomicki <matyax@gmail.com>

* fix lint

* add comment explaining `onCloseContext`

* add comment about debounced onClose

* add comments and remove `showRowMenu`

* scroll twice to correctly center the element

* revert double scrolling

* remove unnecessary `processDataFrame`

* trigger drone

---------

Co-authored-by: Matias Chomicki <matyax@gmail.com>
2023-04-14 17:05:43 +02:00
Ivana Huckova
a31104b107
Loki: Refactor logic for using context filters (#66382)
* Loki: Change logic for using context filters

* Dont add parser and parsed labels if multiple

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

Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>

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

Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>

* Update

* Rename variable

---------

Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
2023-04-14 13:44:02 +02:00
Sven Grossmann
7bc0692801
Logs: Add new LogRowContext types to @grafana/data (#66404)
* Logs: Add new LogRowContext types to grafana/data

* use right type for `RowContextOptions`

* add missing renames
2023-04-13 13:07:28 +02:00
Ivana Huckova
e12598f55c
Loki: Move log context to separate log context provider (#66357)
* Loki: Move log context to separate provider

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

Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>

* Fix lint

---------

Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
2023-04-12 15:09:37 +02:00