40 Commits

Author SHA1 Message Date
2a6ac88a73 QueryInspector: add common way to show the raw query (#25204) 2020-05-29 11:06:33 -07:00
a111cc0d5c Stackdriver: Support for SLO queries (#22917)
* wip: add slo support

* Export DataSourcePlugin

* wip: break out metric query editor into its own component

* wip: refactor frontend - keep SLO and Metric query in differnt objects

* wip - load services and slos

* Fix broken test

* Add interactive slo expression builder

* Change order of dropdowns

* Refactoring backend model. slo unit testing in progress

* Unit test migration and SLOs

* Cleanup SLO editor

* Simplify alias by component

* Support alias by for slos

* Support slos in variable queries

* Fix broken last query error

* Update Help section to include SLO aliases

* streamline datasource resource cache

* Break out api specific stuff in datasource to its own file

* Move get projects call to frontend

* Refactor api caching

* Unit test api service

* Fix lint go issue

* Fix typescript strict errors

* Fix test datasource

* Use budget fraction selector instead of budget

* Reset SLO when service is changed

* Handle error in case resource call returned no data

* Show real SLI display name

* Use unsafe prefix on will mount hook

* Store goal in query model since it will be used as soon as graph panel supports adding a threshold

* Add comment to describe why componentWillMount is used

* Interpolate sloid

* Break out SLO aggregation into its own func

* Also test group bys for metricquery test

* Remove not used type fields

* Remove annoying stackdriver prefix from error message

* Default view param to FULL

* Add part about SLO query builder in docs

* Use new images

* Fixes after feedback

* Add one more group by test

* Make stackdriver types internal

* Update docs/sources/features/datasources/stackdriver.md

Co-Authored-By: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>

* Update docs/sources/features/datasources/stackdriver.md

Co-Authored-By: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>

* Update docs/sources/features/datasources/stackdriver.md

Co-Authored-By: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>

* Updates after PR feedback

* add test for when no alias by defined

* fix infinite loop when newVariables feature flag is on

onChange being called in componentDidUpdate produces an
infinite loop when using the new React template variable
implementation.

Also fixes a spelling mistake

* implements feedback for documentation changes

* more doc changes

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
Co-authored-by: Daniel Lee <dan.limerick@gmail.com>
2020-03-27 12:01:16 +01:00
f95c8b785c Stackdriver: Migrate GCE default project (#22593)
* Ensure default project

* Remove debug logging

* Fix broken test

* Update snapshot
2020-03-05 17:53:41 +01:00
934a8f08ae Stackdriver: Project selector (#22447)
* clean PR #17366

* udpate vendor

* [WIP] Implement projects management for stackdriver

* [WIP] Implement projects management for stackdriver

* [WIP] Implement projects management for stackdriver

* Implement projects management for stackdriver

* [WIP][Tests] Fix errors

* clean anonymous struct

* remove await

* don't store project list

* Add default project on query editor

* gofmt

* Fix tests

* Move test data source to backend

* Use segment instead of dropdown. remove ensure default project since it's not being used anymore.

* Fix broken annotation editor

* Load gceDefaultAccount only once when in the config page

* Reset error message on auth type change

* Add metric find query for projects

* Remove debug code

* Fix broken tests

* Fix typings

* Fix lint error

* Slightly different approach - now having a distiction between config page default project, and project that is selectable from the dropdown in the query editor.

* Fix broken tests

* Attempt to fix strict ts errors

* Prevent state from being set multiple times

* Remove noOptionsMessage since it seems to be obosolete in react select

* One more attempt to solve ts strict error

* Interpolate project template variable. Make sure its loaded correctly when opening variable query editor first time

* Implicit any fix

* fix: typescript strict null check fixes

* Return empty array in case project endpoint fails

* Rename project to projectName to prevent clashing with legacy query prop

* Fix broken test

* fix: Stackdriver - template replace on filter label

should have a regex format as that escapes the dots
in the label name which is not valid.

Co-authored-by: Labesse Kévin <kevin@labesse.me>
Co-authored-by: Elias Cédric Laouiti <elias@abtasty.com>
Co-authored-by: Daniel Lee <dan.limerick@gmail.com>
2020-03-02 09:31:09 -05:00
260239d98b Stackdriver: Support meta labels (#21373)
* Rewrite angular segments for filter and group by in react

* wip: refactoring

* Update metric find queries

* Remove old maps used to create labels - use one map for all types instead

* Use value as label (again) for filters ang groupby

* Remove old filter

* Remove not used code

* Fixes after pr feedback

* Fix broken tests and add new metadata tests

* Add index file to make imports cleaner

* Cleanup. Remove old angular filter code

* Fix broken tests

* Use type switching instead of if statements

* Use globals for regex

* Updates after pr feedback

* Make sure it's possible to filter using the same key multiple times

* Replace metric select with segment component

* Pass template vars as props

* Refactor meta labels code

* Reorder template variables

* Fix broken tests

* Reset metric value when changing service

* Fix lint issue.

* Make tests independant of element order

* Include kubernetes.io in regex

* Add instruction in help section
2020-01-17 12:25:47 +01:00
9b7748ec13 Chore: Reorg packages (#20111)
Primarily- moving majority of the types and utils from @grafana/ui to @grafana/data

* Move types from grafana-ui to grafana-data

* Move valueFormats to grafana-data

* Move utils from grafana-ui to grafana-data

* Update imports in grafana-ui

* revert data's tsconfig change

* Update imports in grafana-runtime

* Fix import paths in grafana-ui

* Move rxjs to devDeps

* Core import updates batch 1

* Import updates batch 2

* Imports fix batch 3

* Imports fixes batch i don't know

* Fix imorts in grafana-toolkit

* Fix imports after master merge
2019-10-31 10:48:05 +01:00
99411bf37a Types: Adds type safety to appEvents (#19418)
* Types: Add type safety to appEvents
2019-10-14 09:27:47 +01:00
c194ae1ba5 Registry: add a reusable function registry (#17047) 2019-07-16 11:40:23 -07:00
3f15170914 Refactor: move some files to @grafana/data (#17952)
* moving to data WIP

* more refactoring

* add missing test

* mock full path

* remove sinon from grafana-ui
2019-07-06 08:05:53 +02:00
0b9de3f761 noImplicitAny: Lower count to about 3450 (#17799) 2019-06-27 15:56:02 +02:00
19e824006a Refactor: Make SelectOptionItem a generic type to enable select value typing (#16718)
* Make SelectOptionItem a generic type to enable select value typing
* TS ignores added because of optional value on Select items (it's no longer any)
2019-04-23 20:44:16 +02:00
0302c7afa7 stackdriver: add some more typings 2019-02-05 15:28:03 +01:00
7b1aed6caf stackdriver: converts some variables from any to types 2019-01-14 23:43:31 +01:00
18abb87cbb stackdriver: small fixes after reactifying 2019-01-14 18:23:01 +01:00
b6171fa3c7 add feedback to what interval is being used (calculated in the backend) 2019-01-11 15:14:35 +01:00
b596550210 use typings for ds and template srv 2019-01-11 13:53:04 +01:00
d51f91f54b unregister event listener correctly 2019-01-09 13:56:15 +01:00
b8c2ba3320 add typing for metric descriptor 2019-01-08 14:03:52 +01:00
8867d8e99c make templateSrv a prop 2019-01-08 13:52:19 +01:00
dc7f98de6a use correct event handler name convention. register directive on startup 2019-01-08 13:37:08 +01:00
f9f51d6819 replace fragment with empty jsx tags 2019-01-08 13:00:31 +01:00
d23c3d2b64 add tests 2019-01-03 15:12:03 +01:00
5ba429387f reactify annotation query editor 2018-12-28 19:45:24 +01:00
8a916757d7 remove segment srv prop 2018-12-21 23:28:21 +01:00
b9cf15786d use ds template srv reference 2018-12-21 23:21:55 +01:00
2f342b8917 remove not used stuff 2018-12-21 23:07:46 +01:00
31254e1c72 add event handler 2018-12-21 22:04:46 +01:00
0515605b9a add help component 2018-12-21 21:38:46 +01:00
e2ed163779 add project and help component 2018-12-20 16:55:02 +01:00
06f771afd3 add alias by component 2018-12-20 15:59:21 +01:00
861f911cda add alignment periods component 2018-12-20 13:36:10 +01:00
7a31076f09 cleanup aggregation picker 2018-12-20 13:27:47 +01:00
1452bc2e8a move alignment population code to parent component. make alignment a stateless component instead. 2018-12-20 11:26:05 +01:00
ec68c65660 flatten target obj 2018-12-20 11:00:16 +01:00
945b0aeb86 add alignment component 2018-12-19 17:12:50 +01:00
603ef1c37d refactor aggregation picker 2018-12-19 16:08:18 +01:00
9b1b4c09f5 use render props pattern 2018-12-19 15:54:45 +01:00
07dc9d06d7 use template variable prop 2018-12-19 14:29:00 +01:00
a955caa9ac cleanup 2018-12-19 14:19:27 +01:00
146aa7abab wip: convert angular directives to react components 2018-12-13 16:40:14 +01:00