Marcus Efraimsson
baab021fec
Chore: Refactor usage of legacy data contracts ( #41218 )
...
Refactor usage of legacy data contracts. Moves legacy data contracts
to pkg/tsdb/legacydata package.
Refactor pkg/expr to be a proper service/dependency that can be provided
to wire to remove some unneeded dependencies to SSE in ngalert and other places.
Refactor pkg/expr to not use the legacydata,RequestHandler and use
backend.QueryDataHandler instead.
2021-11-10 11:52:16 +01:00
Ryan McKinley
490d21fc5c
ds/query: use datasourceId if it exists in the request ( #41446 )
2021-11-09 07:11:09 -08:00
Ryan McKinley
3489721ed6
api/ds/query: simplify data sources lookup for queries and expressions ( #41172 )
2021-11-05 08:12:55 -07:00
Will Browne
14742ea44a
add oauth pass thru logic to api/ds/query ( #41352 )
2021-11-05 15:07:04 +01:00
Will Browne
b80fbe03f0
Plugins: Refactor Plugin Management ( #40477 )
...
* add core plugin flow
* add instrumentation
* move func
* remove cruft
* support external backend plugins
* refactor + clean up
* remove comments
* refactor loader
* simplify core plugin path arg
* cleanup loggers
* move signature validator to plugins package
* fix sig packaging
* cleanup plugin model
* remove unnecessary plugin field
* add start+stop for pm
* fix failures
* add decommissioned state
* export fields just to get things flowing
* fix comments
* set static routes
* make image loading idempotent
* merge with backend plugin manager
* re-use funcs
* reorder imports + remove unnecessary interface
* add some TODOs + remove unused func
* remove unused instrumentation func
* simplify client usage
* remove import alias
* re-use backendplugin.Plugin interface
* re order funcs
* improve var name
* fix log statements
* refactor data model
* add logic for dupe check during loading
* cleanup state setting
* refactor loader
* cleanup manager interface
* add rendering flow
* refactor loading + init
* add renderer support
* fix renderer plugin
* reformat imports
* track errors
* fix plugin signature inheritance
* name param in interface
* update func comment
* fix func arg name
* introduce class concept
* remove func
* fix external plugin check
* apply changes from pm-experiment
* fix core plugins
* fix imports
* rename interface
* comment API interface
* add support for testdata plugin
* enable alerting + use correct core plugin contracts
* slim manager API
* fix param name
* fix filter
* support static routes
* fix rendering
* tidy rendering
* get tests compiling
* fix install+uninstall
* start finder test
* add finder test coverage
* start loader tests
* add test for core plugins
* load core + bundled test
* add test for nested plugin loading
* add test files
* clean interface + fix registering some core plugins
* refactoring
* reformat and create sub packages
* simplify core plugin init
* fix ctx cancel scenario
* migrate initializer
* remove Init() funcs
* add test starter
* new logger
* flesh out initializer tests
* refactoring
* remove unused svc
* refactor rendering flow
* fixup loader tests
* add enabled helper func
* fix logger name
* fix data fetchers
* fix case where plugin dir doesn't exist
* improve coverage + move dupe checking to loader
* remove noisy debug logs
* register core plugins automagically
* add support for renderer in catalog
* make private func + fix req validation
* use interface
* re-add check for renderer in catalog
* tidy up from moving to auto reg core plugins
* core plugin registrar
* guards
* copy over core plugins for test infra
* all tests green
* renames
* propagate new interfaces
* kill old manager
* get compiling
* tidy up
* update naming
* refactor manager test + cleanup
* add more cases to finder test
* migrate validator to field
* more coverage
* refactor dupe checking
* add test for plugin class
* add coverage for initializer
* split out rendering
* move
* fixup tests
* fix uss test
* fix frontend settings
* fix grafanads test
* add check when checking sig errors
* fix enabled map
* fixup
* allow manual setup of CM
* rename to cloud-monitoring
* remove TODO
* add installer interface for testing
* loader interface returns
* tests passing
* refactor + add more coverage
* support 'stackdriver'
* fix frontend settings loading
* improve naming based on package name
* small tidy
* refactor test
* fix renderer start
* make cloud-monitoring plugin ID clearer
* add plugin update test
* add integration tests
* don't break all if sig can't be calculated
* add root URL check test
* add more signature verification tests
* update DTO name
* update enabled plugins comment
* update comments
* fix linter
* revert fe naming change
* fix errors endpoint
* reset error code field name
* re-order test to help verify
* assert -> require
* pm check
* add missing entry + re-order
* re-check
* dump icon log
* verify manager contents first
* reformat
* apply PR feedback
* apply style changes
* fix one vs all loading err
* improve log output
* only start when no signature error
* move log
* rework plugin update check
* fix test
* fix multi loading from cfg.PluginSettings
* improve log output #2
* add error abstraction to capture errors without registering a plugin
* add debug log
* add unsigned warning
* e2e test attempt
* fix logger
* set home path
* prevent panic
* alternate
* ugh.. fix home path
* return renderer even if not started
* make renderer plugin managed
* add fallback renderer icon, update renderer badge + prevent changes when renderer is installed
* fix icon loading
* rollback renderer changes
* use correct field
* remove unneccessary block
* remove newline
* remove unused func
* fix bundled plugins base + module fields
* remove unused field since refactor
* add authorizer abstraction
* loader only returns plugins expected to run
* fix multi log output
2021-11-01 10:53:33 +01:00
Ryan McKinley
6bda64cb19
Grafana: include a built-in backend datasource ( #38571 )
2021-09-10 07:44:47 -07:00
Ryan McKinley
9aa03acfa6
Chore: remove sql testdata ( #38945 )
2021-09-07 16:35:52 -07:00
Arve Knudsen
78596a6756
Migrate to Wire for dependency injection ( #32289 )
...
Fixes #30144
Co-authored-by: dsotirakis <sotirakis.dim@gmail.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Ida Furjesova <ida.furjesova@grafana.com>
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
Co-authored-by: spinillos <selenepinillos@gmail.com>
Co-authored-by: Karl Persson <kalle.persson@grafana.com>
Co-authored-by: Leonard Gram <leo@xlson.com>
2021-08-25 15:11:22 +02:00
Dimitris Sotirakis
050dc7bc8f
Cloudwatch: Unwrap errors - throw error from upstream ( #36334 )
...
* Unwrap errors - throw error from upstream
* Fixes according to reviewer's comments
* Fix linting
* Remove unused code
2021-08-18 10:37:13 +03:00
Ryan McKinley
b02403e3fc
TestData: use new format for random walk example ( #34441 )
2021-05-19 21:59:43 -07:00
Ryan McKinley
1446d094b8
API: return query results as JSON rather than base64 encoded Arrow ( #32303 )
2021-03-31 08:35:03 -07: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
Joan López de la Franca Beltran
6415d2802e
Plugins: Requests validator ( #30445 )
...
* Introduce PluginRequestValidator abstraction with a NoOp implementation
* Update PluginRequestValidator abstraction to use the dsURL instead
* Inject PluginRequestValidator into the HTTPServer and validate requests going through data source proxy
* Inject PluginRequestValidator into the BackendPluginManager and validate requests going through it
* Validate requests going through QueryMetrics & QueryMetricsV2
* Validate BackendPluginManager health requests
* Fix backend plugins manager tests
* Validate requests going through alerting service
* Fix tests
* fix tests
* goimports
Co-authored-by: Leonard Gram <leo@xlson.com>
2021-02-03 20:47:45 +01:00
Marcus Efraimsson
043d6cd584
Backend Plugins: Convert test data source to use SDK contracts ( #29916 )
...
Converts the core testdata data source to use the SDK contracts and by that
implementing a backend plugin in core Grafana in similar manner as an external one.
Co-authored-by: Will Browne <will.browne@grafana.com>
Co-authored-by: Marcus Efraimsson <marefr@users.noreply.github.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-01-29 18:33:23 +01:00
Sofia Papagiannaki
9ada4b6052
Expressions: Add option to disable feature ( #30541 )
...
* Expressions: Add option to disable feature
* Apply suggestions from code review
Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com>
2021-01-22 19:27:33 +02:00
Kyle Brandt
d4edcd1838
Expressions: Remove feature toggle ( #30316 )
...
* Expressions: remove feature toggle, add experimental badge
* Make button only show for backend and mixed data sources
Co-authored-by: Peter Holmberg <peter.hlmbrg@gmail.com>
Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2021-01-19 14:18:06 -05:00
Hugo Häggmark
3d41267fc4
Chore: Moves common and response into separate packages ( #30298 )
...
* Chore: moves common and response into separate packages
* Chore: moves common and response into separate packages
* Update pkg/api/utils/common.go
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
* Chore: changes after PR comments
* Chore: move wrap to routing package
* Chore: move functions in common to response package
* Chore: move functions in common to response package
* Chore: formats imports
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-01-15 14:43:20 +01:00
Arve Knudsen
0e2f1fe3f5
Metrics API: Use jsoniter for JSON encoding ( #30250 )
...
* QueryMetricsV2: Stream response
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
* API: Use jsoniter instead of standard JSON package
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-01-13 15:20:25 +01:00
Arve Knudsen
25048ebdf8
Chore: Add CloudWatch HTTP API tests ( #29691 )
...
* CloudWatch: Add HTTP API tests
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2021-01-07 11:36:13 +01:00
Arve Knudsen
294770f411
Chore: Handle wrapped errors ( #29223 )
...
* Chore: Handle wrapped errors
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
2020-11-19 13:34:28 +01:00
Kyle Brandt
0cb29d337a
Expressions: Move GEL into core as expressions ( #29072 )
...
* comes from grafana/gel-app
* remove transform plugin code
* move __expr__ and -100 constants to expr pkg
* set OrgID on request plugin context
* use gtime for resample duration
* in resample, rename "rule" to "window", use gtime for duration, parse duration before exec
* remove gel entry from plugins-bundled/external.json
which creates an empty array for plugins
2020-11-19 07:17:00 -05:00
Arve Knudsen
b5379c5335
Chore: Fix SQL related Go variable naming ( #28887 )
...
* Chore: Fix variable naming
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-11-11 06:21:08 +01:00
Torkel Ödegaard
3defb4441e
Settings: Remove global variable ( #26613 )
2020-07-26 23:36:36 -07:00
Arve Knudsen
94d0934e90
CloudWatch: Fix a few API status codes ( #26578 )
...
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
2020-07-24 12:34:56 +02:00
Ryan McKinley
b73d237bf8
Query: do not require datasource name and id ( #24718 )
2020-05-14 20:05:16 -07:00
Marcus Efraimsson
890e1d8f94
Backend plugins: Send query type to backend plugins ( #24120 )
...
Use v0.60.0 of sdk.
2020-05-05 10:32:34 +02:00
Ryan McKinley
c65db9bf25
Chore: remove expressions flag and allow ( #22764 )
2020-03-13 07:43:25 -07:00
Carl Bergquist
1dcfaf25fc
Adds signed in user to backend v2 plugins requests ( #22584 )
...
closes #12043
2020-03-06 14:37:36 +01:00
Carl Bergquist
3fdd2648b1
Chore: Avoid aliasing importing models in api package ( #22492 )
2020-03-04 12:57:20 +01:00
Ryan McKinley
4d1b969a5c
GEL: include the expression count in the request ( #20114 )
2019-10-31 16:22:00 -07:00
Ryan McKinley
861eb72113
transform: add expressions to query editor (w/ feature flag) ( #20072 )
...
for use with gel which is not released yet.
2019-10-30 14:38:28 -04:00
Marcus Efraimsson
771f21ed09
api: new v2 metrics query endpoint
...
Requests to endpoint will currently will error unless expressions feature flag is true.
Co-authored-by: Sofia Papagiannaki <papagian@gmail.com>
2019-10-25 09:28:26 -04:00
Marcus Efraimsson
00e7c7c4b7
Testdata: Rename package to circumvent convention in go ( #19409 )
...
Before this change the tests for test datasource was not run.
2019-09-27 16:18:24 +02:00
Marcus Efraimsson
5713048f48
Alerting: Improve alert rule testing ( #16286 )
...
* tsdb: add support for setting debug flag of tsdb query
* alerting: adds debug flag in eval context
Debug flag is set when testing an alert rule and this debug
flag is used to return more debug information in test aler rule
response. This debug flag is also provided to tsdb queries so
datasources can optionally add support for returning additional
debug data
* alerting: improve test alert rule ui
Adds buttons for expand/collapse json and copy json to clipboard,
very similar to how the query inspector works.
* elasticsearch: implement support for tsdb query debug flag
* elasticsearch: embedding client response in struct
* alerting: return proper query model when testing rule
2019-06-25 08:52:17 +02:00
Mario Trangoni
87760d4fde
Codestyle: Fix govet issues ( #17178 )
...
ref #10381
Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>
2019-06-04 22:00:05 +02:00
Marcus Efraimsson
c82df97bb2
testdata: scenarios returned are now sorted in a consistent way ( #17181 )
...
This makes sure the scenarios returned from API are sorted in a consistent
way and by that makes the values in scenario drop down always presented
ordered instead of jumping around.
2019-05-21 09:20:57 +02:00
Marcus Efraimsson
52d825f535
log error on datasource access denied
2018-10-30 09:32:32 +01:00
Marcus Efraimsson
cfb061ddab
refactor datasource caching
2018-10-30 09:31:56 +01:00
Torkel Ödegaard
0e9a6dcedc
Use datasource cache for backend tsdb/query endpoint ( #13266 )
...
fix: use datasource cache for backend datasources
2018-09-14 09:30:32 +02:00
Torkel Ödegaard
276a5e6eb5
fix: test data api route used old name for test data datasource, fixes #12773
2018-07-31 17:29:02 +02:00
Mitsuhiro Tanda
d9bf894383
return 400 if user input error
2018-07-24 17:06:55 +09:00
Mario Trangoni
91fb2e07ce
pkg: fix codespell issues
2018-04-13 20:31:29 +02:00
Julian Kornberger
0a415c50d0
Make golint happier
2018-03-22 22:38:44 +01:00
Julian Kornberger
7aab6a8887
Make golint happier
2018-03-22 12:40:21 +01:00
Dan Cech
c0ecdee375
rename Context to ReqContext
2018-03-07 11:54:50 -05:00
Dan Cech
338655dd37
move Context and session out of middleware
2018-03-06 18:16:49 -05:00
bergquist
ed661767f8
follow go idiom and return error as second param
2017-09-21 18:04:16 +02:00
bergquist
0229d28d64
remove unused structs
2017-09-21 15:02:17 +02:00
bergquist
788f677ed7
remove old internal metrics lib
2017-09-14 14:26:32 +02:00
Torkel Ödegaard
6e344f6eea
api: tsdb api orgId fix
2017-09-12 08:01:34 +02:00