Commit Graph

274 Commits

Author SHA1 Message Date
Erik Sundell
4e591653bd Set query empty condition in render function. Also clear query transactions when no valid query is present 2018-12-04 13:26:26 +01:00
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
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
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
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
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
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
Erik Sundell
109ff1a3e1 includes ranges correctly in the options object 2018-11-26 17:09:50 +01:00
Erik Sundell
ccddee4a4a add support for explore events 2018-11-23 15:12:20 +01:00
Erik Sundell
eaf9a0b39a initial commit 2018-11-22 18:22:15 +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
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
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
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 Kaltschmidt
cf19ecc8f5 Make Explore plugin exports explicit 2018-10-30 14:38:34 +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
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
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
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 Kaltschmidt
9e647590ac Review feedback, increased height 2018-10-18 10:42:25 +02: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
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
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 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
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
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
Torkel Ödegaard
5c24fa68a5 explore: fixes to dark theme, fixes #13349 2018-09-27 11:57:28 +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