Commit Graph

924 Commits

Author SHA1 Message Date
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