Commit Graph

56 Commits

Author SHA1 Message Date
Marcus Efraimsson
348e76fc8e
Datasource: Shared HTTP client provider for core backend data sources and any data source using the data source proxy (#33439)
Uses new httpclient package from grafana-plugin-sdk-go introduced 
via grafana/grafana-plugin-sdk-go#328. 
Replaces the GetHTTPClient, GetTransport, GetTLSConfig methods defined 
on DataSource model.
Longer-term the goal is to migrate core HTTP backend data sources to use the 
SDK contracts and using httpclient.Provider for creating HTTP clients and such.

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-05-19 23:53:41 +02:00
Andrej Ocenas
293677a0cb
Prometheus: Add custom query params for alert and exemplars queries (#32440)
* Add configuration for custom query params

* Add custom transport in prometheus

* Move custom query handling to request method

* Add encoding
2021-05-12 19:30:41 +02:00
Ryan McKinley
7627b55ef4
TSDB: add deprecation comments to many tsdb structs (#33281) 2021-04-23 03:03:11 +02:00
Dimitris Sotirakis
2a5279911f
Add legend name to dataframes config (#32356) 2021-03-26 16:20:46 +02:00
Dimitris Sotirakis
2d72b4e69e
Prometheus: Convert Prometheus query response to dataframes (#31948)
* Convert Prometheus query response to dataframes

* Add parseResponse tests

* Fixed lint imports

* Force use UTC as timezone in timeVector

* Updated test to check timezone
2021-03-18 08:40:26 +02:00
Arve Knudsen
b79e61656a
Introduce TSDB service (#31520)
* Introduce TSDB service

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

Co-authored-by: Erik Sundell <erik.sundell87@gmail.com>
Co-authored-by: Will Browne <will.browne@grafana.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.org>
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2021-03-08 07:02:49 +01:00
Emil Hessman
3c1bcc7275
Chore: Rewrite tsdb prometheus test to standard library (#29592)
Signed-off-by: Emil Hessman <emil@hessman.se>
2020-12-04 08:49:39 +01:00
Arve Knudsen
107f658229
prometheus: Improve IsAPIError's documentation (#29432)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-11-27 12:05:49 +01:00
Will Browne
d10a8b2761
Alerting: Improve Prometheus Alert Rule error message (#29390)
* provide better ctx for prom err

* rework

* Update pkg/tsdb/prometheus/prometheus.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* Update pkg/tsdb/prometheus/prometheus.go

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>

* call func

Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-11-26 13:38:36 +01:00
Arve Knudsen
574553ec7b
Chore: Fix issues found by staticcheck (#28802)
* Fix linting issues

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-11-05 11:29:39 +01:00
Arve Knudsen
41d432b5ae
Chore: Enable whitespace linter (#25903)
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-07-06 20:17:28 +02:00
Arve Knudsen
07582a8e85
Chore: Fix various spelling errors in back-end code (#25241)
* Chore: Fix various spelling errors in back-end code
Co-authored-by: Sofia Papagiannaki <papagian@users.noreply.github.com>
Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>>
2020-06-01 17:11:25 +02:00
Denis
26626d9073
Prometheus: Render missing labels in legend formats as an empty string (#22355)
* Empty value for unknown Prometheus label (grafana#16041)

* Empty value for unknown Prometheus label (grafana#16041)

* fix linter
2020-03-18 19:57:11 +01:00
Marcus Efraimsson
baba1634b8 Plugins: Use grafana-plugin-sdk-go v0.5.0 (#21116)
* fix dispense

* plugin loading refactor

Moves common functionality of registering, starting,
stopping and restarting backend plugins to
backendplugin package.

* simplify plugin descriptors

* target sdk v0.5.0

Co-authored-by: Kyle Brandt <kyle@kbrandt.com>
2020-01-08 11:43:28 -05:00
Weeco
8cd93f0b88 Datasource: Add custom headers on alerting queries (#19508)
* Add custom headers on alerting queries

Reference issue #15381

Signed-off-by: Martin Schneppenheim <martin.schneppenheim@rewe-digital.com>

* Fix datasource transport tests

* Migrate decrypting header test to models pkg

* Check correct header

* Add HTTP transport test

Fixes #15381
2019-10-11 14:28:52 +02:00
Oleg Kovalov
6a76a92aff Prometheus: Preallocate data for Prometheus backend response parsing (#17490) 2019-06-10 08:12:46 +02:00
zhulongcheng
2fff8f77dc move log package to /infra (#17023)
ref #14679

Signed-off-by: zhulongcheng <zhulongcheng.me@gmail.com>
2019-05-13 08:45:54 +02:00
Andrej Ocenas
66f6e16916
Security: Store datasource passwords encrypted in secureJsonData (#16175)
* Store passwords in secureJsonData

* Revert unnecessary refactors

* Fix for nil jsonSecureData value

* Remove copied encryption code from migration

* Fix wrong field reference

* Remove migration and provisioning changes

* Use password getters in datasource proxy

* Refactor password handling in datasource configs

* Add provisioning warnings

* Update documentation

* Remove migration command, moved to separate PR

* Remove unused code

* Set the upgrade version

* Remove unused code

* Remove double reference
2019-04-15 11:11:17 +02:00
Mario Trangoni
80fa66fcb0 Fix some typos found by codespell
See,
$ codespell -S "./.git*,./vendor*,./public*"
2018-09-21 11:54:52 +02:00
Mario Trangoni
ce941a004d fix unconvert issues 2018-04-16 20:04:58 +02:00
bergquist
e234cf5b18 prom: removes limitation of one query per tsdb call 2017-12-22 12:22:42 +01:00
Carl Bergquist
5d6ed6c45f
prom: add support for default step param (#9866)
Alerting for prometheus have been depending on the step parameter from each query.
In https://github.com/grafana/grafana/pull/9226 we changed the behavior for step in the
frontend which caused problems for alerting. This commit fixes that by introducing a default
min interval value so alerting always have something to depend on. 

closes #9777
2017-11-15 11:22:00 +01:00
bergquist
ed661767f8 follow go idiom and return error as second param 2017-09-21 18:04:16 +02:00
bergquist
a45e2ec9c3 context is reserved for go's context 2017-09-21 15:23:34 +02:00
bergquist
16b5b9f6be make ds a param for Query 2017-09-21 15:09:14 +02:00
bergquist
7f9f388293 rename executor into tsdbqueryendpoint 2017-09-21 15:02:17 +02:00
bergquist
0229d28d64 remove unused structs 2017-09-21 15:02:17 +02:00
bergquist
55f1b36e31 refactor response flow 2017-09-21 15:02:17 +02:00
bergquist
e128310045 use tags instead of logs 2017-09-18 11:08:58 +02:00
bergquist
f160ad3bc8 add trace parameters for outgoing requests 2017-09-18 11:08:58 +02:00
bergquist
d6b8c6a2d2 add graphite bridge that support delta counters 2017-09-14 14:26:32 +02:00
Carl Bergquist
7d205ae2b8 Merge pull request #7466 from hagen1778/prometheus-basicauth-query
allow setting basic auth headers for prometheus datasource
2017-02-07 11:18:17 +01:00
hagen1778
a1e835884b use configured Transport instead of defaultHttpTransport 2017-02-07 11:56:59 +02:00
r.khavronenko
25be602dce go fmt 2017-02-06 17:17:16 +02:00
bergquist
57d36b3d42 feat(alerting): transform labels into tags for prometheus tsdb 2017-02-06 15:25:15 +01:00
r.khavronenko
80b92335bb allow setting basic auth headers for prometheus datasource 2017-02-06 16:22:09 +02:00
Torkel Ödegaard
d354f3a8af fix(alerting): fixed evaluation for no_value condition, fixes #7244 (#7247)
* fix(alerting): fixed evaluation for no_value condition, fixes #7244

* feat(alerting): moving null library into grafana, fixing handling on no value / no series
2017-01-13 12:32:30 +01:00
Carl Bergquist
2c7adccf12 Use cache for http.client in tsdb package. (#6833)
* datasource: move caching closer to datasource struct

* tsdb: use cached version of datasource http transport

closes #6825
2016-12-07 11:10:42 +01:00
bergquist
c897d39d5e feat(influxdb): add support for serie alias replacement
ref #6510
2016-11-09 10:22:11 +01:00
bergquist
2d7bb4a9f3 fix(tsdb): broken build :( 2016-11-03 19:20:53 +01:00
bergquist
1afe0e90f9 fix(tsdb): fixes broken legend buidler for prometheus
closes #6456
2016-11-03 18:04:09 +01:00
bergquist
0059beb85d chore(tsdb): remove commented code 2016-11-03 17:34:57 +01:00
bergquist
d4bc92b267 feat(tsdb): default tsdb httpclient 2016-11-02 08:51:34 +01:00
bergquist
20bfe443fe feat(prometheus): trim labelname lookup key
closes #6300
2016-10-19 08:57:58 +02:00
bergquist
d8aa38fafe tech(influxdb): refactor and cleanup 2016-10-06 14:16:26 +02:00
bergquist
ab8751767c feat(influxdb): send request and parse response 2016-10-06 12:51:45 +02:00
Carl Bergquist
c38f6ff182 Make alerting notifcations sync (#6158)
* tech(routines): move the async logic from notification to alerting notifier

* tech(notification): reduce code dupe

* fix(notification): dont touch the response unless its an error

* feat(alerting): make alerting exeuction async but flow sync

* tech(alerting): remove commented code

* tech(alerting): remove unused code

* tech(alerting): fix typo

* tech(alerting): implement Context on EvalContext

* tech(alerting): wait for all alerts to return

* feat(alerting): dont allow alert responses to cancel

* Revert "feat(alerting): dont allow alert responses to cancel"

This reverts commit 324b006c96.

* feat(alerting): give alerts some time to finish before closing down
2016-10-03 09:38:03 +02:00
Torkel Ödegaard
a4648607bb feat(testdata): added csv test data scenario 2016-09-28 10:37:30 +02:00
Torkel Ödegaard
8d5857661e refactor(tsdb): changed tsdb time series model to use null.Float instead of pointers 2016-09-28 09:15:48 +02:00
Torkel Ödegaard
3ecd96e682 feat(testdata): lots of work on new test data data source and scenarios 2016-09-27 18:17:39 +02:00