Commit Graph

78 Commits

Author SHA1 Message Date
Giuseppe Guerra
7996a1c8ad
Chore: Update grafana-plugin-sdk-go to v0.142.0 (#58115)
* Chore: Update grafana-plugin-sdk-go to v0.142.0

* Update tests and golden files for 207 status code

* Chore: Move update flag definition at the top in response_parser_test.go

* retrigger

Co-authored-by: Will Browne <will.browne@grafana.com>
2022-11-03 18:34:27 +01:00
Artur Wierzbicki
1df8a85a42
Search: load dashboard performance improvements (#57509)
* fix windows storage init

* fixxx

* close session asap

* fix span end

* error handling

* add comment

* simplify

* simplify

* fix limit

* pass readDashboardCtx to summary builder

* add string slice validation
2022-10-27 14:52:42 +08:00
Artur Wierzbicki
e485ddd13d
Store: don't marshall/unmarshall the dashboard when building a summary (#57520)
* dont pretty print the dashboard

* stop marshalling the dashboard

* do not sanitize for searchV2

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2022-10-25 09:39:17 +08:00
Kristin Laemmert
05709ce411
chore: remove sqlstore & mockstore dependencies from (most) packages (#57087)
* chore: add alias for InitTestDB and Session

Adds an alias for the sqlstore InitTestDB and Session, and updates tests using these to reduce dependencies on the sqlstore.Store.

* next pass of removing sqlstore imports
* last little bit
* remove mockstore where possible
2022-10-19 09:02:15 -04:00
Artur Wierzbicki
984ec00aac
Search: load dashboards optimization (#56933)
* search: load dashboards optimization

* search: load dashboards optimization

* search: close dashboard channel, return error when context is done

* search: refactor

* search: return err on ctx done

* search: remove sleep
2022-10-18 23:53:15 +08:00
Ryan McKinley
3b4b528993
Storage: Dashboard summary builder cleanup (#56665) 2022-10-13 09:29:19 -04:00
idafurjes
ef651daed2
Use org service instead of sqlstore (#56407)
* Use org service instead of sqlstore

* Remove methods from sqlstore

* Remove commented out code

* Fix lint

* Fix lint 2
2022-10-13 08:40:46 -04:00
Ryan McKinley
b24be6c0fc
ObjectStore: add a kind registry (#56507) 2022-10-08 12:05:46 -04:00
Nathan Marrs
ac91df0ea2
Canvas: Add demo dashboards (#56351)
Co-authored-by: drew08t <drew08@gmail.com>
Co-authored-by: Adela Almasan <adela.almasan@grafana.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2022-10-07 21:34:18 -04:00
Artur Wierzbicki
bf264d2f76
Query library: requiresDevMode dummy backend (#56466)
* query library - dummy backend

* fix tests

* dont explicitly marshall backend dataresponse

* skip integration tests

* null check for tests

* added query library to codeowners

* null check for tests

* lint
2022-10-07 11:31:45 -07:00
Ryan McKinley
97d19830cf
ObjectStore: rename modified to updated (#56420) 2022-10-05 14:58:46 -04:00
Kat Yang
7715672fb3
Chore: use org service methods (#55768)
* Chore: use org service methods

* fix tests

* fix errors

* adjust func signatures for getbyname

* 💩

* Use the same fake service to get the user in AC and in HS

* Fix middleware test

* Fix more middleware test

* Fix api tests

Co-authored-by: gamab <gabi.mabs@gmail.com>
Co-authored-by: Ida Furjesova <ida.furjesova@grafana.com>
2022-10-04 14:48:02 -04:00
Ryan McKinley
385ebea540
Devenv: move timeseries dashboards to a timeseries folder (#56131) 2022-09-30 13:10:20 -07:00
Ryan McKinley
268a49cb38
Devenv: add dashboard showing timeseries out of range points (#56130) 2022-09-30 15:47:23 -04:00
Ryan McKinley
e7e7763252
Store/Search: Explore a general interface to extract summary data from a blob (#55598) 2022-09-27 18:08:47 -04:00
Artur Wierzbicki
814211282a
Search: Fix tags query (#55851)
* Search: fix tags query

* Search: fix type
2022-09-27 21:16:49 +04:00
Kristin Laemmert
701f6d5436
UserService: use the UserService instead of calling sqlstore directly (#55745)
* UserService: update callers to use the UserService instead of calling sqlstore directly

There is one major change hiding in this PR. UserService.Delete originally called a number of services to delete user-related records. I moved everything except the actual call to the user table, and moved those into the API. This was done to avoid dependencies cycles; many of our services depend on the user service, so the user service itself should have as few dependencies as possible.
2022-09-27 07:58:49 -04:00
Artur Wierzbicki
f8d69415ca
Search: create a separate HTTP endpoint (#55634)
* search: create a separate http endpoint

* search: extract api uri

* search: rename uri

* search: replicate the readiness check

* search: replicate the readiness check metric

* search: update mock
2022-09-22 19:02:09 -04:00
Artur Wierzbicki
1f2cab9036
SearchV2: add more tracing spans (#55488)
* add additional spans to searchv2

* add initial setup span

* add dashboardCount attribute to readDashboard span

* add dashboard count to init org index span

* fix merge

Co-authored-by: Todd Treece <todd.treece@grafana.com>
2022-09-21 16:14:52 +02:00
Artur Wierzbicki
c3ca5405ce
Search: Add search index configuration options (#55525)
* Search: externalize config

* Search: update config descriptions

* Search: fix value

* Search: fix

* update

* Search: revert config values

* Search: rename copy/paste

* Search: fix tests
2022-09-20 19:09:55 -04:00
Artur Wierzbicki
9db2720016
Search: improve logging in case of failed dashboard loading phase (#55523) 2022-09-20 23:50:29 +02:00
Artur Wierzbicki
03af63d52e
SearchV2: add tracing to background jobs (#55250)
* searchv2: add tracing to background jobs

* searchv2: lint

* searchv2: lint

* searchv2: fix context passing

* searchv2: add init org index span

* searchv2: add traceid to logs

* searchv2: add db count to logs
2022-09-20 16:49:44 +02:00
idafurjes
eff4daacaf
Bug: Rollback change in search (#55443) 2022-09-20 12:18:39 +02:00
idafurjes
7ce7c9b64c
Chore: Move SearchOrgs to org service (#55416)
* Chore: Move SearchOrgs to org service

* Fix lint

* Fix lint 2
2022-09-20 09:55:40 +02:00
Emil Tullstedt
b287047052
Chore: Upgrade Go to 1.19.1 (#54902)
* WIP

* Set public_suffix to a pre Ruby 2.6 version

* we don't need to install python

* Stretch->Buster

* Bump versions in lib.star

* Manually update linter

Sort of messy, but the .mod-file need to contain all dependencies that
use 1.16+ features, otherwise they're assumed to be compiled with
-lang=go1.16 and cannot access generics et al.

Bingo doesn't seem to understand that, but it's possible to manually
update things to get Bingo happy.

* undo reformatting

* Various lint improvements

* More from the linter

* goimports -w ./pkg/

* Disable gocritic

* Add/modify linter exceptions

* lint + flatten nested list

Go 1.19 doesn't support nested lists, and there wasn't an obvious workaround.
https://go.dev/doc/comment#lists
2022-09-12 12:03:49 +02:00
Artur Wierzbicki
1353177e15
Search: Add substring matcher (#54813)
* search: bring back substring search

* lint fix

* search: bring back ngram

* search: bring back ngram

* search: more tests
2022-09-08 12:10:30 +02:00
Artur Wierzbicki
9284216880
Search: ordering tests (#54432)
* search ordering tests

* lintt
2022-08-30 18:58:19 +02:00
Artur Wierzbicki
74158ed66b
Search: use SQL search as a fallback during bluge's initial indexing (#54095)
* Search: use SQL search as a fallback when bluge indexing is ongoing

* Search: lint

* Search: feedback fixes - return an empty frame with a special name

* Search: revert readiness check query type

* Search: remove println

* remove sleep, get coffee
2022-08-26 12:36:41 +04:00
Karl Persson
55c7b8add2
RBAC: Split up service into several components (#54002)
* RBAC: Rename interface to Store

* RBAC: Move ranme scopeInjector

* RBAC: Rename files to service

* RBAC: Rename to service

* RBAC: Split up accesscontrol into two components

* RBAC: Add DeclareFixedRoles to AccessControl interface

* Wire: Fix wire bindings

* RBAC: Move resolvers to root

* RBAC: Remove invalid test

* RBAC: Inject access control service

* RBAC: Implement the RoleRegistry interface in fake
2022-08-24 13:29:17 +02:00
idafurjes
a14621fff6
Chore: Add user service method SetUsingOrg and GetSignedInUserWithCacheCtx (#53343)
* Chore: Add user service method SetUsingOrg

* Chore: Add user service method GetSignedInUserWithCacheCtx

* Use method GetSignedInUserWithCacheCtx from user service

* Fix lint after rebase

* Fix lint

* Fix lint error

* roll back some changes

* Roll back changes in api and middleware

* Add xorm tags to SignedInUser ID fields
2022-08-11 13:28:55 +02:00
Jo
062d255124
Handle ioutil deprecations (#53526)
* replace ioutil.ReadFile -> os.ReadFile

* replace ioutil.ReadAll -> io.ReadAll

* replace ioutil.TempFile -> os.CreateTemp

* replace ioutil.NopCloser -> io.NopCloser

* replace ioutil.WriteFile -> os.WriteFile

* replace ioutil.TempDir -> os.MkdirTemp

* replace ioutil.Discard -> io.Discard
2022-08-10 15:37:51 +02:00
idafurjes
6afad51761
Move SignedInUser to user service and RoleType and Roles to org (#53445)
* Move SignedInUser to user service and RoleType and Roles to org

* Use go naming convention for roles

* Fix some imports and leftovers

* Fix ldap debug test

* Fix lint

* Fix lint 2

* Fix lint 3

* Fix type and not needed conversion

* Clean up messages in api tests

* Clean up api tests 2
2022-08-10 11:56:48 +02:00
Alexander Emelin
e791a4e576
Search: Move entity events to transaction (#52394) 2022-08-01 18:56:36 +03:00
Artur Wierzbicki
784cfcf2b0
Search: add request metrics (#53028)
* Search: add request metrics

* Search: consistent naming

* Search: remove success counter

* Search: update buckets

* Search: remove log
2022-08-01 15:23:41 +04:00
Artur Wierzbicki
18daa6754c
Previews: datasource permissions (#52747)
* Previews: datasource permissions

* lint

* simplify - force non-null `ds_uids`

* add `canBeDisabled` to search service

* add `IncludeThumbnailsWithEmptyDsUids`

* remove force refresh migration

* refactor main preview service

* add safeguard

* revert ticker interval

* update testdata

* fix test

* add mock search service

* add datasources lookup test

* update migration

* extract ds lookup to its own package to avoid cyclic imports

* lint

* fix dashbaord extract, use the real datasource lookup in tests. IS IT BULLETPROOF YET?!

* fix dashbaord extract, use the real datasource lookup in tests. IS IT BULLETPROOF YET?!

* remove stale log

* consistent casing

* pass context to `createServiceAccount`

* filter out the special grafana ds
2022-07-28 16:40:26 +04:00
Artur Wierzbicki
17ea5f4f3e
Search: Handle special datasource types (#52446) 2022-07-22 21:10:53 -04:00
Artur Wierzbicki
bcfa4fabf6
Search: Allowed actions (#52529) 2022-07-22 17:42:43 -07:00
Ryan McKinley
eb6d6d0d2b
Search: pass the 'explain' flag from the UI and debug paging issues (#51847) 2022-07-08 15:28:21 -04:00
Artur Wierzbicki
c372b892ec
fix nil pointer dereference (#51978) 2022-07-08 19:27:53 +04:00
Artur Wierzbicki
63366615bb
Search: support datasource template variables when parsing dashboard JSON models (#51587)
* init

* support template variables

* support variables without curly braces

* add todo for `__all` case

* fix `$__all` case for non-multivalue

* extract some functions

* fix flakinesss

* support `$__all` and `default` template variables

* add todo

* compilation fix

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2022-07-08 01:59:24 +04:00
Ryan McKinley
4fa606c600
Export: save all dashboards to git (#48233) 2022-07-05 10:54:07 -07:00
Alexander Emelin
f233a74b70
Search: Downgrade Bluge, refactor code (#51560)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2022-07-04 11:33:07 +03:00
Artur Wierzbicki
0ca4ccfa96
Search: fix logging statements (#51633) 2022-07-01 15:38:31 -07:00
Alexander Emelin
a2478c3a32
Search: Sort by updated at and created at (#50416)
Co-authored-by: Artur Wierzbicki <artur.wierzbicki@grafana.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2022-06-30 16:33:30 -07:00
Alexander Emelin
0975ea4df8
Search: Filter punctuation and tokenize camel case (#51165)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2022-06-30 16:30:44 -07:00
Ryan McKinley
b6a9b9804d
Plugin admin: Add a page to show where panel plugins are used in dashboards (#50909) 2022-06-27 20:23:43 -04:00
Alexander Emelin
120c92b950
Search: Fix indexing - re-index after initial provisioning (#50959) 2022-06-27 18:11:08 +03:00
Alexander Emelin
cef81a6478
Search: Update bluge version (#50377) 2022-06-22 15:49:26 +03:00
Alexander Emelin
54e9408cfd
Search: Build indexes on start for all orgs (#50762) 2022-06-22 13:12:07 +03:00
Alexander Emelin
1ca2e2b6c2
Search: Sync state on read for HA consistency (#50152) 2022-06-22 12:21:43 +03:00