Commit Graph

97 Commits

Author SHA1 Message Date
David
a69ab2fb3a
Merge pull request #14299 from grafana/14273-clear-scanning
Explore: Stop scanning when clear all button is clicked
2018-12-04 12:37:04 +01:00
Erik Sundell
f8cef73b5b stop scanning when clear all button is clicked 2018-12-04 11:28:04 +01:00
David Kaltschmidt
4ce79349a3 Explore: return to grid layout for logs table
- better column control than flexbox
- increased gutter and row spacing
2018-12-04 10:48:28 +01:00
David
ba18b470a4
Merge pull request #14260 from grafana/davkal/fix-14258
Explore: Show logging errors from backend
2018-12-03 10:00:22 +01:00
David
fab2597650
Merge pull request #14259 from grafana/14237-prevent-table-crash
change obj order when merging so that correct format is being used
2018-11-30 16:37:50 +01:00
David Kaltschmidt
47468fca68 Explore: Show logging errors from backend
- Logging datasource sends error string directly in the message body
- allowing response body to be an error when query transaction failed
- added throw in case we ever encounter unhandled errors again (forces us to fix the issue)
2018-11-30 16:09:56 +01:00
Erik Sundell
12ba314e24 change obj order when merging so that correct format is being used 2018-11-30 15:58:01 +01:00
David Kaltschmidt
a513130493 Fixed typo in function name 2018-11-30 15:19:09 +01:00
David Kaltschmidt
979f3f3e0c Review feedback
- fixed typo
- moved result calculation to explore utils
- use component keys instead of componentWillReceiveProps
- require logs to have and id, to as use as Logs component key
- render delay based on row count
2018-11-30 12:26:57 +01:00
David Kaltschmidt
ae26f7126f Explore: Logging render performance
- moved from grid to flexbox
- calculate Explore results only when query transactions change to prevent expensive re-renders
- split up rendering of graph and log data
- render log results in 2 stages
2018-11-29 17:30:11 +01:00
David Kaltschmidt
c3b67f3a13 Explore: Logging label filtering
- adds a custom label renderer to Logs viewer in Explore
- labels are no longer treated as strings, they are passed as parsed objects to the log row
- label renderer supports onClick handler for an action
- renamed Explore's `onClickTableCell` to `onClickLabel` and wired up log label renderers
- reuse Prometheus `addLabelToSelector` to modify Logging queries via click on label
- added tests to `addLabelToSelector`, changed to include the surrounding `{}`
- use label render also for common labels in the controls panel
- logging meta data section has now a custom renderer that can render numbers, strings, and labels
- style adjustments
2018-11-28 14:20:10 +01:00
David Kaltschmidt
593cc38cfc Added stop scan button 2018-11-27 16:35:37 +01:00
David Kaltschmidt
4803b8f3c0 Explore: Scan for older logs
Sometimes log streams dont return any lines for the given range. Would be great to automate the search until some logs are found.

- Allow Explore to drive TimePicker via ref
- Show `Scan` link in Logs when there is no data
- Click on `Scan` sets Explore into scanning state
- While scanning, tell Timepicker to shift left
- TimePicker change triggers new queries with shifted time range
- Remember if query transaction was started via scan
- keep scanning until something was found
- Manual use of timepicker cancels scanning
2018-11-27 15:56:10 +01:00
David
9afb8b64ed
Merge pull request #14176 from grafana/davkal/explore-logging-level-filter
Explore: Filter logs by log level
2018-11-27 12:23:45 +01:00
David Kaltschmidt
4f55a238ed Explore: Filter logs by log level
- add `onToggleSeries` to Explore Graph props
- toggling a Logging Graph series from the legend propagates its hidden series to Logs
- Logs translates hidden series alias to LogLevels
- Logs filters out hidden log levels
2018-11-23 16:29:55 +01:00
David Kaltschmidt
f831836fa7 Explore: make query field suggestions more robust
- drop invalid history items
- make highlighter more robust by defaulting to empty string on text to highlight
2018-11-23 12:25:43 +01:00
David
377eaa891c
Merge pull request #14147 from grafana/davkal/explore-data-query
Explore: Introduce DataQuery interface for query handling
2018-11-22 12:01:37 +01:00
David Kaltschmidt
9e94d22401 Added comments 2018-11-22 12:00:41 +01:00
David Kaltschmidt
21ee85b1e2 Fix issue with deleting a query (empty string not updating) 2018-11-22 11:14:46 +01:00
David Kaltschmidt
331d419d4f Combine query functions 2018-11-21 17:21:13 +01:00
David Kaltschmidt
22987ee75f Renamed targets to queries 2018-11-21 16:28:30 +01:00
David Kaltschmidt
b3161bea5a Explore: Introduce DataQuery interface for query handling
- Queries in Explore have been string based
- This PR introduces the use of the DataQuery type to denote all queries handled in Explore
- Within Explore all handling of DataQueries is transparent
- Modifying DataQueries is left to the datasource
- Using `target` as variable names for DataQueries to be consistent with the rest of Grafana
2018-11-21 14:45:57 +01:00
Michael Huynh
a333c31ea8
Fix set utilities for explore section
Discovered implementation issues with the set utilities used in the
explore section after adding some tests. Added tests to reinforce the
expected behaviour of the utility functions.

Related: #13522
2018-11-21 21:42:53 +08:00
Michael Huynh
c7dc557e91
Add visibility toggle for explore graph series
The implemented toggling UX is similar to how the dashboard graph plugin
behaves. Also incorporates review feedback to persist series visibility
state by means of the alias property, with the limitation it carries
too.

Related: #13522
2018-11-20 21:52:42 +08:00
David Kaltschmidt
4771eaba5b Explore: POC dedup logging rows
- added dedup switches to logs view
- strategy 'exact' matches rows that are exact (except for dates)
- strategy 'numbers' strips all numbers
- strategy 'signature' strips all letters and numbers to that only whitespace and punctuation remains
- added duplication indicator next to log level
2018-11-19 16:26:47 +01:00
David Kaltschmidt
adb2430a1b Explore: collapsible result panels
- replace the Graph/Table buttons with toggle control in a wrapper panel
- moved toggle control to left to be close to the label
- removed panel styles from Logs and Graph viewer
- moved loader animation to panel
2018-11-16 18:21:13 +00:00
David
634d71a657
Merge pull request #14052 from grafana/davkal/explore-query-importer
Explore: POC for datasource query importers
2018-11-16 14:55:19 +00:00
David Kaltschmidt
411719bc70 Explore: POC for datasource query importers
Explore is about keeping context between datasources if possible. When
changing from metrics to logging, some of the filtering can be kept to
narrow down logging streams relevant to the metrics.

- adds `importQueries` function in language providers
- query import dependent on origin datasource
- implemented  prometheus-to-logging import: keeping label selectors
  that are common to both datasources
- added types
2018-11-16 13:52:58 +00:00
David Kaltschmidt
9b48338d95 Explore: Dont set datasource in state if navigated away
Datasource selection triggers a connection test, on success
the DS is set in the Explore state. If the test takes long and user
selects a different DS, and just after that the first test succeeds,
then the first DS overwrites the state.

* when test returns check if datasource is still the requested one
2018-11-12 18:06:12 +00:00
Michael Huynh
22b8b04dbe
Preserve suffix text when applying function suggestion
Updates all PromQL function-like suggestions to omit parentheses
when inserted. Such insertions also preserve any suffix text.

Related: #13885
2018-11-09 20:43:20 +08:00
David Kaltschmidt
6b8d7c89ac Refactored log stream merging, added types, tests, comments 2018-11-08 14:24:54 +01:00
David Kaltschmidt
e39e82949d Adaptive bar widths for log graph 2018-11-06 11:07:12 +01:00
David Kaltschmidt
c1ca1ed35e Time selection via graph 2018-11-05 23:36:58 +01:00
David Kaltschmidt
583334df05 Explore: Logging graph overview and view options
- Logging gets a graph for log distribution (currently per stream, but I
  think I'll change that to per log-level)
- added grid columns for timestamp and unique labels
- show common labels of streams
- View options to show/hide time columns, label columns
- created `--small` modifier for Switch CSS classes
- merging of streams is now a datasource responsibility
2018-11-02 08:25:36 +01:00
David Kaltschmidt
037167ff07 Fix TimePicker test by enforcing UTC on date string 2018-10-30 16:50:03 +01:00
David Kaltschmidt
c92f5462fe Explore: repair logging after code restructuring
this is a fix-up PR that cleans up Explore Logging after the recent
restructuring.

- log results need to be merged since query transactions have been
  introduced
- logging DS has its own language provider, query field, and start page
  (some of them based on prometheus components)
- added loader animation to log viewer
- removed logging logic from prometheus components
2018-10-30 16:35:49 +01:00
David
758ec4bc70
Merge pull request #13844 from grafana/davkal/explore-empty-page
Explore: Pluggable components from datasource plugins
2018-10-30 14:54:34 +01:00
David Kaltschmidt
cf19ecc8f5 Make Explore plugin exports explicit 2018-10-30 14:38:34 +01:00
David Kaltschmidt
5a23723f2c Explore: fix copy/paste on table cells
When selecting text via mouse, our ReactTable cells' click handler
triggers an event.

- check event target to be the link, only then handle the event
2018-10-29 16:44:50 +01:00
David Kaltschmidt
d0776937b5 Pluggable components from datasource plugins
- when instantiating a datasource, the datasource service checks if the
  plugin module exports Explore components, and if so, attaches them to
  the datasource
- Explore component makes all major internal pluggable from a datasource
  `exploreComponents` property
- Moved Prometheus query field to promehteus datasource and registered
  it as an exported Explore component
- Added new Start page for Explore, also exported from the datasource
2018-10-29 15:14:36 +01:00
David
b00e709aee
Merge pull request #13842 from grafana/davkal/explore-error-handling
Explore: error handling and time fixes
2018-10-29 15:08:14 +01:00
Michael Huynh
d1d5e9f7d3
Add tests to cover PlaceholdersBuffer and sum hint
Related: #13615
2018-10-28 21:07:40 +08:00
Michael Huynh
c255b5da11
Add sum aggregation query suggestion
Implements rudimentary support for placeholder values inside a string
with the `PlaceholdersBuffer` class. The latter helps the newly added
sum aggregation query suggestion to automatically focus on the label
so users can easily choose from the available typeahead options.

Related: #13615
2018-10-28 21:03:39 +08:00
David Kaltschmidt
bf1af66292 Explore: error handling and time fixes
- use global range types
- add ErrorBoundary around individual Explore components
- fix table merge on empty results
- fix TimePicker date parsing on ISO dates
- fix TimePicker range string after relative move
2018-10-26 18:16:00 +02:00
David Kaltschmidt
6f2315d5c5 Moved prom language features to datasource language provider 2018-10-25 12:24:24 +02:00
David Kaltschmidt
54a3e2d1d1 Added types to query rows 2018-10-24 14:55:56 +02:00
David
a6fc74e35b
Merge pull request #13803 from grafana/davkal/explore-fix-resize
Explore: fix graph resize on window resize
2018-10-24 12:32:27 +02:00
David
8f7686c5a7
Merge pull request #13773 from miqh/fix/click-typeahead-suggestion
Fix click-based selection of typeahead suggestion
2018-10-24 11:42:58 +02:00
David Kaltschmidt
d6ff16fe72 Explore: fix graph resize on window resize
- resize HOC wrapper only resized first child which in case of large
  graphs was the warning button
- moved warning button inside the panel parent
2018-10-24 11:30:32 +02:00
David Kaltschmidt
a121cd0e49 Fix race condition on add/remove query row 2018-10-24 11:08:15 +02:00