40 Commits

Author SHA1 Message Date
5116420e9a Fix misspell issues (#23905)
* Fix misspell issues

See,
$ golangci-lint run --timeout 10m --disable-all -E misspell ./...

Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>

* Fix codespell issues

See,
$ codespell -S './.git*' -L 'uint,thru,pres,unknwon,serie,referer,uptodate,durationm'

Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>

* ci please?

* non-empty commit - ci?

* Trigger build

Co-authored-by: bergquist <carl.bergquist@gmail.com>
Co-authored-by: Kyle Brandt <kyle@grafana.com>
2020-04-29 21:37:21 +02: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
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
4c8f417f18 Stackdriver: Add extra alignment period options (#18909)
* Add more alignment period options

* Remove unnecessary alignment period limit
2019-09-13 10:45:59 +02:00
44e6da6b41 build: fix integer overflow in pkg/tsdb tests on 32bit platforms (#16818)
Several pkg/tsdb tests fail to compile on 32bit platforms due to
integer overflow.
2019-05-06 09:27:45 +02:00
d1e249a803 stackdriver: fix for float64 bounds for distribution metrics
Adds support for explicit distribution metrics and float64 bounds

Fixes #14509
2019-02-24 17:37:26 +01:00
9b6746d808 Change primaryAggregation to crossSeriesReducer in Stackdriver 2019-01-29 19:11:54 +01:00
a1d4675169 Merge pull request #13490 from mtanda/stackdriver_distribution
Stackdriver heatmap support. Fixes #13559
2018-10-09 20:57:21 +02:00
7e6a5c0a74 stackdriver: add tests from regex matching 2018-10-08 15:57:30 +02:00
a3122a4b85 stackdriver: test build filter string 2018-10-08 15:57:30 +02:00
5f7795aa1f stackdriver: test that no interpolation is done when there are no wildcards 2018-10-08 15:57:30 +02:00
035be6cbbe stackdriver: add more tests 2018-10-08 15:57:30 +02:00
68332c5951 stackdriver: fix broken substring. also adds tests 2018-10-08 15:57:30 +02:00
c2c0cdb49c add test 2018-10-03 16:27:11 +09:00
ec4139d56b pkg/tsdb/stackdriver/stackdriver_test.go: return simplified
See,
pkg/tsdb/stackdriver/stackdriver_test.go:356:2⚠️ 'if err != nil { return data, err }; return data, nil' can be simplified to 'return data, err'
2018-10-01 18:24:00 +02:00
399e83f91b stackdriver: remove metric.category alias pattern
After discussions with the Stackdriver team, they did not think this was
needed.
2018-09-28 17:16:35 +02:00
0507ff69fb stackdriver: resolve merge conflict 2018-09-27 10:32:30 +02:00
481b8653d9 stackdriver: update alignment period rules according to stackdriver 2018-09-27 10:20:01 +02:00
6358d3f314 stackdriver: set target to be raw query 2018-09-27 10:14:10 +02:00
3c6c456592 stackdriver: use more appropriate test data 2018-09-27 09:19:24 +02:00
75a2ea5c71 stackdriver: fix broken test 2018-09-26 18:04:04 +02:00
af9033f3e0 stackdriver: distinct grafana auto from stackdriver auto in alignment period 2018-09-26 15:44:09 +02:00
4777689f29 stackdriver: skeleton for more query types on the backend 2018-09-24 16:02:35 +02:00
681cd7496e stackdriver: alias patterns WIP
This is using the {{}} syntax for alias patterns. Might
switch to the  syntax instead.
2018-09-23 22:04:24 +02:00
ddee919edc stackdriver: remove WIP tests 2018-09-20 20:34:16 +02:00
8211f7d0ea stackdriver: add templating support for metric, filter and group by
Still have to figure out if we should have templating for aggregation
fields
2018-09-20 11:44:17 +02:00
8d1f293676 stackdriver: use group by fields to create default alias 2018-09-20 00:52:14 +02:00
edf38f040d stackdriver: making sure we dont pass too big alignmentPeriods to the stackdriver api 2018-09-17 17:13:06 +02:00
f839d12de4 stackdriver: fix broken tests 2018-09-17 16:33:38 +02:00
71b1f7f8fd stackdriver: use alignment period that is passed from frontend. if set to auto, use value provided from the panel. also added tests for alignment period 2018-09-17 16:30:06 +02:00
669a1029ed stackdriver: type rename 2018-09-14 17:46:42 +02:00
8b72853d36 stackdriver: add support for filtering to backend 2018-09-14 16:20:51 +02:00
d0a565d853 stackdriver: improve segments for group bys in query editor 2018-09-14 09:39:17 +02:00
5763d3cae2 stackdriver: make sure distinct labels are returned. also added test 2018-09-14 09:39:17 +02:00
9c8593e71f stackdriver: wip - group bys 2018-09-14 09:39:16 +02:00
df6b430405 stackdriver: reverse points array to be in ascending order 2018-09-14 09:38:16 +02:00
f4fe26c659 stackdriver: adds support for primary aggregations
WIP: Hardcoded values for the aligner and alignment period. Need
to set the aligment period to the closest min interval and
research the aligner more.
2018-09-14 09:38:16 +02:00
0b5783563e stackdriver: better error handling and show query metadata
If the Stackdriver returns an error, show that error in the query
editor. Also, allow the user to see the raw querystring that was sent
to google (for troubleshooting).
2018-09-14 09:38:16 +02:00
2683699ab4 stackdriver: tests for parsing api response 2018-09-14 09:38:16 +02:00
54f16d5558 stackdriver: add first test for parsing frontend queries 2018-09-14 09:38:16 +02:00