Commit Graph

269 Commits

Author SHA1 Message Date
Patrick O'Carroll
7837ee4466 Updated rules for variable name (#13106)
* updated rules for variable name and fixed files that didn't follow new rules

* fixed test so it uses new rule

* made exceptions to rule in interval_variable
2018-09-03 11:00:46 +02:00
Patrick O'Carroll
552a61b6ae changed var to let in 50 files (#13075) 2018-08-30 09:03:11 +02:00
Torkel Ödegaard
272c09513f tslint: added a new tslint rule 2018-08-30 07:34:17 +02:00
Patrick O'Carroll
a702603e7b changed var to const 2 (#13068)
* changed var to const

* fixed typo created in last commit

* added or empty object to options in prometheus/datasource
2018-08-29 14:27:29 +02:00
Torkel Ödegaard
314b645857
tslint: changing vars -> const (#13034) 2018-08-26 18:43:07 +02:00
Torkel Ödegaard
9b978b7203
tslint: autofix of let -> const (#13033) 2018-08-26 17:14:40 +02:00
Marcus Efraimsson
6ace01fbed
Merge pull request #12893 from grafana/davkal/12889-explore-fix-rate-filter
Explore: Fix label filtering for rate queries
2018-08-21 10:37:38 +02:00
Marcus Efraimsson
dd796bfbe3
Merge remote-tracking branch 'origin/master' into davkal/12889-explore-fix-rate-filter 2018-08-21 09:51:17 +02:00
Marcus Efraimsson
75db4d8eee
Merge remote-tracking branch 'origin/master' into davkal/explore-rate-hinting 2018-08-21 09:48:07 +02:00
Tobias Skarhed
a65589a5fb Rename test files 2018-08-14 10:52:41 +02:00
David Kaltschmidt
978e89657e Explore: Fix label filtering for rate queries
- exclude `]` from match expression for selector injection to ignore
  range vectors like `[10m]`
2018-08-13 12:53:12 +02:00
Julien Pivotto
48364f0111 Add support for $__range_s (#12883)
Fixes #12882

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
2018-08-13 07:53:41 +02:00
David Kaltschmidt
0f5945c557 Explore: still show rate hint if query is complex
- action hint currently only works for very simple queries
- show a hint w/o action otherwise
2018-08-10 15:29:21 +02:00
David Kaltschmidt
128a5d98e1 Explore: expand recording rules for queries
- load recording rules from prometheus
- map rule name to rule query
- query hint to detect recording rules in query
- click on hint fix expands rule name to query
2018-08-08 16:56:21 +02:00
David
c1b9bbc2cf Explore: Query hints for prometheus (#12833)
* Explore: Query hints for prometheus

- time series are analyzed on response
- hints are shown per query
- some hints have fixes
- fix rendered as link after hint
- click on fix executes the fix action

* Added tests for determineQueryHints()

* Fix index for rate hints in explore
2018-08-08 17:50:30 +03:00
David
bda49fcaa2 Add click on explore table cell to add filter to query (#12729)
* Add click on explore table cell to add filter to query

- move query state from query row to explore container to be able to set
  modified queries
- added TS interface for columns in table model
- plumbing from table cell click to datasource
- add modifyQuery to prometheus datasource
- implement addFilter as addLabelToQuery with tests

* Review feedback

- using airbnb style for Cell declaration
- fixed addLabelToQuery for complex label values
2018-08-03 11:20:13 +03:00
Tobias Skarhed
951b623bd2 Change to arrow functions 2018-08-01 14:27:45 +02:00
Tobias Skarhed
af32bfebef Add all tests to one file 2018-08-01 14:26:29 +02:00
Tobias Skarhed
790aadf8ef Remove angularMocks 2018-08-01 10:09:05 +02:00
Tobias Skarhed
d6158bc293 All tests passing 2018-08-01 09:30:26 +02:00
Tobias Skarhed
e4c2476f3c Weird execution order for the tests... 2018-07-31 09:35:08 +02:00
Tobias Skarhed
3d4a346c66 Begin conversion 2018-07-30 13:02:08 +02:00
Marcus Efraimsson
d8d748d2aa
remove unneeded comment 2018-07-24 17:40:00 +02:00
Tobias Skarhed
51caf470f5 Remove influx qeury_ctrl jest, as it is already completed 2018-07-24 14:56:14 +02:00
Tobias Skarhed
49a8c2e0c1 Make beautiful 2018-07-24 14:56:13 +02:00
Tobias Skarhed
c0f9c06f21 Karma to Jest: completer 2018-07-24 14:56:13 +02:00
Tobias Skarhed
6b6a23ff6a Add support for interval in query variable
Add range to scopedVars

Add basic tests and extract function for range vars

Add support for range query variable in createQuery

Template vars squash
2018-07-23 14:33:21 +02:00
David Kaltschmidt
1f74b298c4 Remove string casting for template variables in prometheus 2018-07-16 13:02:36 +02:00
David Kaltschmidt
1efe34e6cf Make prometheus value formatting more robust
- prometheus datasources passes its own interpolator function to the
  template server
- that function relies on incoming values being strings
- some template variables may be non-strings, e.g., `__interval_ms`,
  which throws an error

This PR makes this more robust.
2018-07-16 12:40:55 +02:00
David Kaltschmidt
390090da05 Set datasource in deep links to Explore 2018-07-13 09:45:56 +02:00
David Kaltschmidt
d06b26de26 Explore Datasource selector
Adds a datasource selector to the Explore UI. Only datasource plugins
that have `explore: true` in their `plugin.json` can be selected.

- adds datasource selector (based on react-select) to explore UI
- adds getExploreSources to datasource service
- new `explore` flag in datasource plugins model
- Prometheus plugin enabled explore
2018-07-13 09:09:36 +02:00
Mitsuhiro Tanda
18a8290c65 (prometheus) prevent error to use $__interval_ms in query (#12533)
* prevent error to use $__interval_ms in query

* add test

* prevent error to use $__interval_ms in query
2018-07-11 11:13:47 -07:00
Alexander Zobnin
36f08994cc
prometheus heatmap: fix unhandled error when some points are missing 2018-07-05 16:33:52 +03:00
David
0d1f7c8782 Fix bar width issue in aligned prometheus queries (#12483)
* Fix bar width issue in aligned prometheus queries

This was broken because null values were filled in with unaligned times.

* use aligned times for result transformation
* add tests

An earlier version of this fix aligned the times again in the transformer, but
I think it's safe to only deal with aligned times in the response.

* Fixed prometheus heatmap tranformer test

The interval needs to be 1 to prevent step alignment.
2018-07-02 11:04:36 -07:00
David
7a3c1e162c
Merge pull request #11942 from grafana/davkal/design-integration
Explore: Time selector, split view, design integration
2018-05-30 12:27:24 +02:00
David Kaltschmidt
750ea9bbdd Changed Prometheus interval-alignment to cover whole panel range
* the existing query date alignment shifts the range forward to match
a multiple epoch of the interval, but keeps the range length the same,
the result is that the start date is shifted forward as well, leaving a
gap in the graph (or a zero-line when null-as-zero was set, issue #12024)
* this pr extends the aligned range to cover the original start date as
well
2018-05-25 16:46:38 +02:00
David Kaltschmidt
eadaff6191 Explore: Design integration
* style header like other grafana components
* use panel container for graph and same styles for query field
* fix typeahead CSS selector (was created outside of .explore)
* use navbar buttons for +/- of rows
* moved elapsed time under run query button
* fix JS error on multiple timeseries being returned
* fix color for graph lines
* show prometheus query errors
2018-05-24 10:55:00 +02:00
Mitsuhiro Tanda
067ceb178e Revert "move queryTimeout option to common setting"
This reverts commit 3ba59a1d66a2a3c07ccd04a48c403f0772fbef31.
2018-05-21 21:45:51 +09:00
Mitsuhiro Tanda
12ace5ab65 move queryTimeout option to common setting 2018-05-21 21:45:51 +09:00
Mitsuhiro Tanda
8ddcd67080 add query timeout option for Prometheus 2018-05-21 21:45:51 +09:00
Torkel Ödegaard
6c0752473a
Sqlstore refactor (#11908)
* refactor: tracing service refactoring

* refactor: sqlstore to instance service

* refactor: sqlstore & registory priority

* refactor: sqlstore refactor wip

* sqlstore: progress on getting tests to work again

* sqlstore: progress on refactoring and getting tests working

* sqlstore: connection string fix

* fix: not sure why this test is not working and required changing expires

* fix: updated grafana-cli
2018-05-18 11:10:10 +02:00
David Kaltschmidt
e731c248d7 Prometheus step alignment: shift interval only on jitter
* only increase interval by step if jitter happened
* shift both start and end
* simplified tests by using low epoch numbers
2018-05-14 12:08:30 +02:00
David
06aca5e8b5
Merge branch 'master' into prometheus_align_queries 2018-05-08 12:22:55 +02:00
David
1236b7b918
Merge pull request #11770 from grafana/davkal/explore-panel-link
Explore: Add entry to panel menu to jump to Explore
2018-05-07 16:31:19 +02:00
Mitsuhiro Tanda
253b2cc081 add test for prometheus table column title 2018-05-01 05:00:56 +09:00
David Kaltschmidt
8a53ec610b Fix url encoding, expand template vars, fix TS hacks
* moved datasource related functions to panel sub-class
* expand panel template vars for url
* added keybindings for x -> Explore
* url encoding for explore state
2018-04-30 17:44:30 +02:00
David Kaltschmidt
05b0bfafe4 Explore: Add entry to panel menu to jump to Explore
* panel container menu gets new Explore entry (between Edit and Share)
* entry only shows if datasource has `supportsExplore` set to true (set
 for Prometheus only for now)
* click on Explore entry changes url to `/explore/state` via location provider
* `state` is a JSON representation of the panel queries
* datasources implement `getExploreState()` how to turn a panel config into explore initial
 state
* Explore can parse the state and initialize its query expressions
* ReactContainer now forwards route parameters as props to component
* `pluginlist` and `singlestat` panel subclasses needed to be adapted because
 `panel_ctrl` now has the location provider as a property already
2018-04-30 17:44:28 +02:00
Mitsuhiro Tanda
c2b720835b fix to match table column name and order 2018-04-27 19:34:10 +09:00
Marcus Efraimsson
f112e38266
prometheus: convert metric find query tests to jest 2018-04-25 15:37:58 +02:00
Marcus Efraimsson
6687409efb
prometheus: fix variable query to fallback correctly to series query
Using a query of for example up or up{job=job1}
2018-04-25 15:37:58 +02:00