* Move log's typings into grafana/ui
* Update the way context is retrieved for Loki
Major changes:
1. getLogRowContext expects row to be of LogRowModel type
2. getLogRowContext accepts generic options object, specific to a datasource of interest. limit option has been removed, and now it's a part of Loki's context query options (see below)
3. LogRowContextProvider performs two queries now. Before, it was Loki ds that performed queries in both directions when getLogRowContext.
4. Loki's getLogRowContext accepts options object of a type:
interface LokiContextQueryOptions {
direction?: 'BACKWARD' | 'FORWARD';
limit?: number;
}
This will enable querying in either direction independently and also slightly simplifies the way query errors are handled.
LogRowContextProvider maps the results to a Loki specific context types, basically string[][], as raw log lines are displayed in first version.
* azuremonitor: revert to clearing chained dropdowns
After feedback from users, changing back to clearing
dropdowns to the right in the chain. E.g. if the user
changes the subscription dropdown which is first in
the chain then all the dependent dropdowns to the right
should be cleared (reset to default values).
Also, now triggers getting subscriptions every time the
dropdown menu is shown rather than just the first time.
It is apparently common to add subscriptions while
building queries.
* Apply panel options defaults on panel init and on save model retrieval
* Remove unnecessary argument, added tests
* Make FieldPropertiesEditor statefull to enable onBlur changes
* Remove unnecessary import
* Post-review updates
Fixes#17154
* fix: azuremonitor adds multi-sub support to alerting
* fix: AzureMonitor missing parameter in metadata func
getMetricMetadata function when called in the query ctrl
was missing a parameter for Subscription Id.
Also, made some tweaks to what happens when a chained
dropdown is changed to not reset all the fields that
are dependent on it.
Adds logs scenario which is quite basic and not that smart
to begin with. This will hopefully ease development of
Explore and support for logs in Grafana.
* Fix: the type is not set so can check for columns and rows to validate is table (#16996)
* Fix: the type is not set so can check for columns and rows to validate is table (#16996)
* Fix: fix no table check and tests (#16996)
* Wip: Initial commit
* Refactor: Adds support in Loki datasource for streaming
* Refactor: Adds Live option to RefreshInterval
* Refactor: Adds styles to logrows
* Style: Reverses the order of Explore layout on Live
* Refactor: Adds LiveLogs component
* Tests: Adds tests for epics
* Style: Adds animation to Live in RefreshPicker
* Refactor: Adds ElapsedTime and progress line to LiveLogs
* Style: Adds specific colors to each theme
* Refactor: Adds support for Lokis new API
* Fix: Adds null to resulting empty array
* Refactor: Limits the rate of incoming messages from websockets
* Refactor: Throttles messages instead for simplicity
* Refactor: Optimizes row processing performance
* Refactor: Adds stop live button
* Fix: Fixes so that RefreshPicker shows the correct value when called programmatically
* Refactor: Merges with master and removes a console.log
* Refactor: Sorts rows in correct order and fixes minor UI issues
* Refactor: Adds minor improvments to sorting and container size
This adds some logic to identify if the user is selecting
text and if so disables parsing of log messages on hover.
This should resolve the issue of selecting log lines to be
copied and the selection is truncated.
Fixes#17072
* Extend DataSourceAPI to enable log row context retrieval
* Add react-use package
* Display log row context in UI
* Make Loki datasource return "after" log context in correct order
* Don't show Load more context links when there are no more new results
* Update getLogRowContext to return DataQueryResponse
* Use DataQueryResponse in log row context provider, filter out original row being duplicated in context
Removes the functionality of being able to collapse/expand the logs
container.
When both graph and table are collapsed and you reload the page
then the start page should not be displayed.
When both graph and table are collapsed and you reload the page
then the graph and table panels should be displayed.
Fix so that reducer tests are run. On of the test used fit() instead of
it() which had the consequence of only 1 reducer test was executed
and the rest skipped. There was some failing tests that now is
updated and now passes.
Fixes#17098
Fixes a regression introduced in #16959 which removed datasource
property from changed query for angular query editors having the
result of loading explore URL's without datasource loaded the
default query in query editor and Explore.
Ref #16808
* Fix: if current sort key is not active column, do not use for sort and select next available active (#16980)
* Fix: only sort if sortkey is active column and table is active (#16980)
* Fix: sorting stacked series as legend. current descending order test (#16980)
* Fix: existing sort tests and added additional to prevent bug from resurfacing (#16980)
Adds basic support for switching between Metrics and Logs in Explore.
Currently only test datasource that supports both Metrics and Logs.
Summary of changes:
* Moves mode (Metric, Logs) selection to the left of datasource
picker and add some quick styling.
* Only trigger change in ToggleButton if not selected
* Set correct mode if datasource only supports logs
Closes#16808
* Fix: Only set scrollTop on CustomScroll element when it's needed and move arrow functions out of the props
* Fix: Update snapshots
* Minor refactoring to reuse same functions when rendering custom scrollbar
Fixes#16796
* (feat/explore): Support for new LogQL filtering syntax
Loki is adding syntax to support chained filtering.
This PR adapts Grafana to support this.
- Send only `query` parameter in loki request
- Automatically wrap search text in simple syntax, e.g., `{} foo` is
sent as `{} |~ "foo"`.
* Adapted to regexp parameter staying on in Loki
* Dont wrap single regexp in new filter syntax
* Fix datasource test
* Fallback regexp parameter for legacy queries
* Fix search highlighting
* Make highlighting work for filter chains
* Fix datasource test
* fix(explore): Prevent double querying for Prometheus and Loki
- queries were triggered twice because two Enter handlers existed
- removed runner plugin from Loki and Prom query fields (runner plugin
is still being used in azure)
Part of #16995
* Set loki's mtrics capability to false
Loki is not a metrics store. Explore was using the `metrics` field in
the plugin definition to issue a second query run. But Loki shows only
one result viewer.
Fixes#16995