Commit Graph

924 Commits

Author SHA1 Message Date
Erik Sundell
f8cef73b5b stop scanning when clear all button is clicked 2018-12-04 11:28:04 +01:00
Erik Sundell
2be92af456 Use origin meta 2018-12-04 11:13:16 +01:00
Erik Sundell
541a691aca only display scan button if there is at least one existing selector that returned an empty result 2018-12-04 11:00:21 +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
Erik Sundell
e21ca3f545 Revert commit 2018-12-03 17:17:57 +01:00
Erik Sundell
d9d84f45bc only make it possible to scan for older logs if there is at least one non failing selector 2018-12-03 16:58:46 +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
Erik Sundell
3c556c4833 never load fallback query field. remove commented code 2018-11-30 13:53:39 +01:00
Erik Sundell
be85944d84 add an error alert component that will be displayed when there was an error loading ds in explore 2018-11-30 13:51:49 +01:00
Erik Sundell
c40bfb8eda make sure target obj is not destructured so that angular copy of objected can be mutated 2018-11-30 12:49:05 +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
Erik Sundell
3d45b5ba73 make getAll return array instead of object 2018-11-30 09:48:59 +01:00
Erik Sundell
df75fb0e6d remove obsolete test 2018-11-30 09:32:36 +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
Erik Sundell
d1a2488392 pass data correctly to event handler 2018-11-29 14:20:15 +01:00
Erik Sundell
3162dda088 remove explore check - make it possible to load all datasources 2018-11-29 10:46:50 +01:00
Erik Sundell
6f85fa6b35 add new flag in order to be able to indicate whether the datasource has native support for tables 2018-11-28 15:06:22 +01:00
Erik Sundell
18abd987bb prevent explore from crashing when table is not present in response 2018-11-28 14:31:20 +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
Erik Sundell
4eebede9ef add current editor to panel targets 2018-11-27 16:50:09 +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
Erik Sundell
626a94be46 remove time srv initialization 2018-11-27 14:51:03 +01:00
Erik Sundell
7159b369a3 restructure imports 2018-11-27 14:49:03 +01:00
Erik Sundell
5e7d4beacf get intervals from explore function 2018-11-27 14:45:39 +01:00
Erik Sundell
b36db6ac04 unregister all query editor event listeners 2018-11-27 14:27:33 +01:00
Erik Sundell
c79d8b2a9b remove comments 2018-11-27 14:25:24 +01:00
Erik Sundell
c567d75320 temp remove until stackdriver implements explore 2018-11-27 14:22:39 +01:00
Erik Sundell
1998c08df5 use default range from time picker 2018-11-27 13:13:26 +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
Erik Sundell
109ff1a3e1 includes ranges correctly in the options object 2018-11-26 17:09:50 +01:00
Erik Sundell
3395b1caf6 Merge branch 'panel-edit-in-react' of https://github.com/grafana/grafana into panel-edit-in-react 2018-11-26 13:44:32 +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
Erik Sundell
7209c7cd0a mock interval data 2018-11-23 15:37:49 +01:00
Erik Sundell
1e6ea8b124 rename variable 2018-11-23 15:15:41 +01:00
Erik Sundell
ccddee4a4a add support for explore events 2018-11-23 15:12:20 +01:00
Erik Sundell
fae3ae2580 use plugin_loader directly instead of using the wrapper 2018-11-23 14:32:56 +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
Erik Sundell
eaf9a0b39a initial commit 2018-11-22 18:22:15 +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
David Kaltschmidt
f19ffee5b4 Fix rebase, fix empty field still issuing query problem 2018-10-23 17:21:33 +02:00
David Kaltschmidt
0cd89e80ca Submit query when enabling result viewer 2018-10-23 16:13:23 +02:00
David Kaltschmidt
fbed57ab43 Get query hints per query transaction 2018-10-23 16:10:52 +02:00
David Kaltschmidt
2e02a8c855 Explore: query transactions
Existing querying was grouped together before handed over to the
datasource. This slowed down result display to however long the slowest
query took.

- create one query transaction per result viewer (graph, table, etc.)
  and query row
- track latencies for each transaction
- show results as soon as they are being received
- loading indicator on graph and query button to indicate that queries
  are still running and that results are incomplete
- properly discard transactions when removing or changing queries
2018-10-23 16:09:48 +02:00
Michael Huynh
3bb0b0a551
Fix click-based selection of typeahead suggestion
In short, the underlying problem appears to be the `onChange()` handler
being triggered after handling the blur event. Since the contents have
not actually changed this forces the typeahead state to reset which
undesirably puts a stop to propagating the selected suggestion back up
to get set.

Related: #13604
2018-10-21 12:51:21 +08:00
David Kaltschmidt
374fe9dcb4 Explore: reuse table merge from table panel
- Extracted table panel's merge logic to combine multiple tables into one
- Put the merge logic into the table model as it merges multiple table
  models
- make use of merge in Explore's table query response handler
- copied tests over to table model spec, kept essential tests in
  transformer spec
2018-10-19 15:29:58 +02:00
David
bf1a0585ed
Merge pull request #13712 from grafana/davkal/explore-react-table
Explore: Use react-table as table component
2018-10-18 12:44:56 +02:00
David Kaltschmidt
9e647590ac Review feedback, increased height 2018-10-18 10:42:25 +02:00
David
1d60c45a04
Merge pull request #13663 from miqh/fix/label-value-suggestions
Fix typeahead behaviour for QueryField
2018-10-17 16:56:02 +02:00
Michael Huynh
22e0ff8b9c Update PromQueryField tests to address fixed bug
Related: #13484
2018-10-17 22:09:21 +08:00
Michael Huynh
a8c5ab76b3
Fix typeahead behaviour for QueryField
These changes were originally intended to address a bug whereby a
suggestion for an already selected label value continues to appear.
However, they also appear to fix several other problems in the area:

- Wrong suggestions when using negated label matching operators
- Misaligned label value suggestion replacements

Related: #13484
2018-10-17 22:09:03 +08:00
David Kaltschmidt
ff67213b42 Explore: Use react-table as table component
- adds react-table as dependency
- replaces custom table component in Explore
- vendors react-table styles and overrides them (currently in
  explore.scss)
2018-10-17 14:58:04 +02:00
Peter Holmberg
ee0cc9bd77 Merge branch 'master' into data-source-instance-to-react 2018-10-16 12:14:11 +02:00
Torkel Ödegaard
69e0311cbc Merge branch '13425-team-picker-bug' 2018-10-11 12:52:48 -07:00
David Kaltschmidt
dcee0771ad Initialize Explore datasource correctly 2018-10-10 14:55:41 +02:00
Johannes Schill
ffae3e7a58 Rename css class "gf-form-select2" to "gf-form-select-box" #13425 2018-10-10 14:15:28 +02:00
Johannes Schill
be7ed3ebca Upgrade Datasources-picker on Explore page #13425 2018-10-10 14:15:26 +02:00
David Kaltschmidt
76a3b1a793 Explore: highlight typed text in suggestions
- use react-highlight-words
- add highlighting (color and border) to the matching substring of the
  suggested items in the typeahead
- extracted match finding from logging datasource
- created new utils/text.ts class for text-related functions
- added more types
2018-10-09 12:33:25 +02:00
David
352961b3d7
Merge pull request #13540 from grafana/davkal/explore-compact-url-state
Explore: compact state URLs
2018-10-08 19:25:56 +02:00
David
6fcc062bda
Merge pull request #13541 from grafana/davkal/13535-fix-syntax-reload
Explore: trigger a query field render to fix highlighting
2018-10-08 19:25:40 +02:00
David
4a85d012e1
Merge pull request #13542 from grafana/davkal/13531-fix-default-suggestions
Explore: do not show default suggestions after expressions
2018-10-08 19:25:18 +02:00
Torkel Ödegaard
07eba60e24
Merge pull request #13537 from grafana/new-data-source-as-separate-page
New data source as separate page
2018-10-06 20:42:13 +02:00
David Kaltschmidt
6260a6d2f3 Explore: do not show default suggestions after expressions
- an expression ends on closing braces
- exclude expressions from the default/empty suggestions
2018-10-05 18:51:49 +02:00
David Kaltschmidt
e0b8b1b7af Explore: trigger a query field render to fix highlighting
- some syntax rules are loaded asynchronously
- when they have been received, the query field needs to re-render
- trigger re-render via bogus edit (tried other methods but could not
  find any)
2018-10-05 18:27:33 +02:00
David Kaltschmidt
5ec9adb7a7 Explore: compact state URLs
- allow positional state array in URL
- key-based parsing as fallback
- fix issue where split state was kept in URL after closing split
2018-10-05 17:09:40 +02:00
David
f6d332562a
Merge pull request #13529 from grafana/davkal/13517-resize-graph
Explore: resize graph on window resize
2018-10-05 16:14:25 +02:00
Peter Holmberg
e1c77f634d Merge branch 'master' into new-data-source-as-separate-page 2018-10-05 13:15:26 +02:00
David Kaltschmidt
64af094204 Use size-me to resize explore Graph, added types 2018-10-05 11:39:00 +02:00
David Kaltschmidt
a0b21db053 Explore: reset typeahead on cursor move 2018-10-04 17:25:31 +02:00
David Kaltschmidt
5cb9dc99ca Explore: resize graph on window resize 2018-10-04 16:56:54 +02:00
David Kaltschmidt
bdae399322 Prevent Explore from updating when typing query
- remove `edited` property of query objects
- query object semantics changes to be initial values only
- resetting or externally modifying a query is done via giving it a new
  react key, which replaces the row completely
- query changes while typing are sent up to Explore to be saved in a
  local property that is not part of the component state (prevent
  control circle)
- all Explore functions using the queries must access the local property
  for current values
2018-10-04 15:32:28 +02:00
David Kaltschmidt
dc4b0cf2ca Avoid new metrics options being passed selector, made PromField pure 2018-10-04 15:28:33 +02:00
David Kaltschmidt
538ea1127e Perf on query field and typeahead
- Lower debounce
- refactor suggestion selection
- make Portal pure
- use prev suggestions object if suggestions are the same
2018-10-04 15:28:33 +02:00
David Kaltschmidt
9914071cc0 Dont rebuild datasource options on each render 2018-10-04 15:28:32 +02:00
David Kaltschmidt
68dfc5699b Moved explore helpers to utils/explore 2018-10-01 12:56:26 +02:00
David
7b543ca4b5
Merge pull request #13463 from grafana/davkal/explore-url-state
Explore: Store UI state in URL
2018-10-01 10:09:15 +02:00
David
b2758b2ad0
Merge pull request #13408 from grafana/limit-number-of-series-in-explore
Limit number of time series in explore
2018-09-28 17:45:33 +02:00
David Kaltschmidt
12c43d6436 Added test for url state in Explore 2018-09-28 17:39:53 +02:00
David Kaltschmidt
c3e0d4205c Make Explore a pure component 2018-09-28 17:38:50 +02:00
David Kaltschmidt
200784ea4a Explore: Store UI state in URL
Storing queries, split state, and time range in URL.

- harmonize query serialization when generating Explore URLs in
  dashboards (use of `renderUrl`)
- move URL parse/serialization to Wrapper
- keep UI states under two keys, one for left and one for right Explore
- add option to angular router to not reload page on search change
- add lots of types
- fix time service function that gets triggered by URL change
2018-09-28 16:44:07 +02:00
Peter Holmberg
e50a87aec9 using constant 2018-09-28 12:58:01 +02:00
Peter Holmberg
327cdf34d5 using constant 2018-09-27 14:32:54 +02:00
Torkel Ödegaard
5c24fa68a5 explore: fixes to dark theme, fixes #13349 2018-09-27 11:57:28 +02:00
Peter Holmberg
3590ca2632 Added constant 2018-09-26 15:18:46 +02:00
Peter Holmberg
bb20e5cb94 created test for graph disclaimer 2018-09-25 11:50:55 +02:00
Peter Holmberg
ecf08b060c limit number of time series show in explore graph 2018-09-24 16:35:24 +02:00
David Kaltschmidt
d07a3a7637 Explore: moved code to app/features/explore 2018-09-24 12:16:06 +02:00