Commit Graph

4263 Commits

Author SHA1 Message Date
Yuriy Tseretyan
0b3c60fc22
Alerting: Refactor notifiers VictorOps, Threema, Telegram to use encoding/json to parse settings instead of simplejson (#55779)
* update victorops
* update threema
* update telegram
2022-09-27 16:58:18 -04:00
Alexander Weaver
e6f99fc418
Alerting: Decouple schedule package from store (#55858)
* Separate out fake for scheduler tests

* Delete extracted methods from older fake
2022-09-27 13:48:12 -05:00
owensmallwood
664aa795c1
PublicDashboards: Add metric for public dashboard datasource query success (#55701)
Adds metric for which datasource queries are successful or not with pubdash.
2022-09-27 12:25:56 -06:00
Artur Wierzbicki
814211282a
Search: Fix tags query (#55851)
* Search: fix tags query

* Search: fix type
2022-09-27 21:16:49 +04:00
Alexander Weaver
81b631d1e9
Use separate fake for rule reader (#55835) 2022-09-27 10:33:32 -05:00
idafurjes
edcf359473
Chore: Copy org sqlstore methods to org store (#55825)
* Chore: Copy org sqlstore methods to org store

* Remove GetByName, add some tests

* Rename GetByNameHandler to GetByName

* Fix fake name
2022-09-27 16:53:45 +02:00
Alexander Weaver
d17ab82b98
Alerting: Break up store.RuleStore interface, delete dead code (#55776)
* Refactor state manager to not depend on rule store interface

* Refactor grafana and proxied ruler APIs to not depend on store.RuleStore

* Refactor folder subscription logic to not use store.RuleStore

* Delete dead code

* Delete store.RuleStore
2022-09-27 08:56:30 -05:00
idafurjes
56cfe02ca2
Chore: Remove methods from sqlstore interface (#55802)
* Remove SearchOrgUsers from sqlstore interface

* Remove RemoveOrgUser method from sqlstore interface

* Delete RemoveOrgUser from sqlstore

* Fix lint
2022-09-27 15:33:38 +02:00
ying-jeanne
b96a3832d0
StoreSplit: move dashboard thumbs into thumbs service (#55800)
* move dashboard thumbs into thumbs service

* rename some variables
2022-09-27 08:46:03 -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
idafurjes
d8cd30d22a
Chore: Remove DeleteOrg and UpdateOrgAddress from sqlstore (#55795)
* Chore: Remove DeleteOrg and UpdateOrgAddress from sqlstore

* Remove commented out methods
2022-09-27 12:30:10 +02:00
Piotr Jamróz
becdf10f0e
Glue: Add DB migration & support provisioning for user-defined correlations config (#55560)
* Allow provisioning correlation config

* Simplify code

* Fix reading correlations test

* Fix linting errors

* Fix linting errors

* remove simpleJson

* Clean up

* Fix tests

* Update swagger docs

* Fix linting

* Fix linting

* Clean up swagger definitions

Co-authored-by: Elfo404 <me@giordanoricci.com>
2022-09-27 11:08:02 +02:00
George Robinson
a49fcbdbbc
Alerting: Add frames for all queries and expressions (#55609)
This commit is one of two commits to make the data frames for all queries and expressions in an alert rule available to the state package for rendering a graph. It renames Result to Condition, and creates an additional field called
Results that is a map of Ref ID to data.Frames.
2022-09-27 10:05:29 +01:00
idafurjes
2bfd26249b
Chore: Remove methods from store interface (#55765)
* Chore: Remove methods from store interface

* Fix api tests

* Remove sqlstore methods, add org store tests, add GetOrgUsers to org store interface

* Fix lint

* Remove debug logs

* Remove commented out methods
2022-09-27 10:34:31 +02:00
Alexander Emelin
55aae79744
GRPC Server: Add gRPC server service (#47849)
Co-authored-by: Todd Treece <todd.treece@grafana.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2022-09-26 16:25:34 -04:00
Alexander Weaver
f11495a4c3
Alerting: Remove dead functionality from alert instance store (#55774)
* Update tests to use ListAlertInstances

* Drop the actual methods rather than just updating tests
2022-09-26 14:38:53 -05:00
Alexander Weaver
a00879ae21
Alerting: Refactor store to not export its own interface for InstanceStore, delete dead dependency injection (#55772)
* Add consumer-side store interface to state manager

* Remove dead dependency

* Delete dead dependency in API struct

* Delete store-layer InstanceStore interface

* Move fake for state's InstanceStore interface to state package
2022-09-26 13:55:05 -05:00
Alexander Weaver
bd6a5c900f
Alerting: Extract ticker into shared package (#55703)
* Move ticker files to dedicated package with no changes

* Fix package naming and resolve naming conflicts

* Fix up all existing references to moved objects

* Remove all alerting-specific references from shared util

* Rename TickerMetrics to simply Metrics

* Rename base ticker type to T and rename NewTicker to simply New
2022-09-26 12:35:33 -05:00
idafurjes
846a4510b4
Chore: Use org service methods (#55738)
* Chore: Use org service methods

* Fix loginservice test

* User Serach from org service

* Fix test
2022-09-26 18:53:17 +02:00
Yuriy Tseretyan
29fdbf0354
Alerting: Refactor webhook notifier to use encoding/json to parse settings instead of simplejson (#55517)
* update webhook to use json marshaller
* make maxAlerts to be interface{}
2022-09-26 12:51:58 -04:00
Giordano Ricci
d07abdd23c
Correlations: Only return correlation for which both source and target datasources exist (#55454)
* Correlation: only return correlation for which both source and targe ds exist

* add test
2022-09-26 14:05:04 +01:00
Torkel Ödegaard
018733dd24
PluginDetails: Make plugin details page look good in topnav (#55571)
* PluginDetails: Make plugin details page look good in topnav

* Minor style tweak aligning things

* minor refactoring where I moved the logic to decide the default tab into its own hook.

* refactor(plugindetails): first pass at using navmodel for usePluginDetailsTabs hook

* refactor(plugindetails): move "reset page when uninstalling plugin" to installcontrols

this prevents a user from seeing a blank page if they uninstall an app plugin whilst viewing a
config page

* refactor(plugindetails): remove usage of toIconName and reduce nested if

* Trying to fix tests

* minor fix

* test(plugindetails): update selectors causing failing tests

* chore(plugindetails): remove commented out test code

* test(plugindetails): clean up - remove unnecesary usage of waitFor

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
2022-09-26 15:04:07 +02:00
ying-jeanne
70c2a31513
move models of dashboard thumbs into its package (#55729) 2022-09-26 12:37:34 +02:00
Maksim Nabokikh
d1e50580a5
Add the file label to dashboard provisioning errors (#53282)
Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>

Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>
2022-09-26 10:57:37 +02:00
idafurjes
178cd0a232
Use OrgUser method from org service (#55674)
* Use OrgUser method from org service

* Use GetOrgUser from org service
2022-09-26 10:27:38 +02:00
Jean-Philippe Quéméner
f3a307778a
Alerting: cache general folder in migration based on org id (#55620) 2022-09-23 18:22:45 +02:00
Ashley Harrison
366731d8d9
Navigation: Add descriptions to NavModelItems (#55669)
* add some descriptions!

* Update some descriptions

* Tweak playlist description

* fix unit tests + betterer
2022-09-23 16:08:08 +01:00
Jean-Philippe Quéméner
0f2afb6417
Alerting: support env variables in contact point settings when provsioning (#55666) 2022-09-23 08:06:51 -05:00
idafurjes
fb66439c3e
Chore: Add orguser methods to org service interface (#55668)
* Move role types to a separate package

* Make role type singular and remove _ from directory name

* Add orguser methods to org service

* Fix fake method
2022-09-23 07:19:34 -04:00
idafurjes
7f98f4b411
Move role types to a separate package (#55665)
* Move role types to a separate package

* Make role type singular and remove _ from directory name
2022-09-23 12:40:02 +02:00
Sofia Papagiannaki
d0e7765c6a
Annotation: Optionally allow storing longer annotation tags (#54754)
* Annotation: Optionally allow longer annotation tags

* Do not accept configuration lower than today's default (500)

* Apply suggestion from code review
2022-09-23 06:04:41 -04:00
idafurjes
883c7a802b
Chore: Use AddUserOrg from org service (#55657)
* Chore: Copy methods from sqlstore to org store

* Rename method, add test

* Add comments of tests

* Chore: Add methods from sqlstore to org service interface

* Avoiding import cycle

* Add and remove some methods

* User AddOrgUSer from org service in api

* Fix test function calls
2022-09-23 11:59:07 +02:00
idafurjes
e8a60c1988
Chore: Add methods from sqlstore to org service interface (#55635)
* Chore: Copy methods from sqlstore to org store

* Rename method, add test

* Add comments of tests

* Chore: Add methods from sqlstore to org service interface

* Avoiding import cycle

* Add and remove some methods
2022-09-23 09:58:17 +02: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
Torkel Ödegaard
09f4068849
NavTree: Refactor out the navtree building from api/index.go and into it's own service (#55552) 2022-09-22 22:04:48 +02:00
Serge Zaitsev
4c19e83ff0
Chore: Move team store implementation to a separate package (#55514)
* Chore: move team store implementation to a separate package

* trying to fix more tests

* fix tests in service accounts and access control

* fix common tests

* restore commented out test

* add todos
2022-09-22 19:16:21 +02:00
idafurjes
591df92265
Chore: Copy methods from sqlstore to org store (#55615)
* Chore: Copy methods from sqlstore to org store

* Rename method, add test

* Add comments of tests
2022-09-22 19:02:55 +02:00
Ieva
6f93630e97
RBAC: add check for whether a role is managed (#55617)
* add check for whether a role is managed

* fix typo
2022-09-22 15:00:42 +01:00
Sofia Papagiannaki
2f14575dd3
Chore: Move annotations cleanup to the annotations service (#55618) 2022-09-22 15:27:48 +03:00
Yuriy Tseretyan
2d38664fe6
Alerting: Improve validation of query and expressions on rule submit (#53258)
* Improve error messages of server-side expression 
* move validation of alert queries and a condition to eval package
2022-09-21 15:14:11 -04:00
Yuriy Tseretyan
879241a48f
Alerting: Fix state manager tests (#55593) 2022-09-21 13:57:18 -05:00
Yuriy Tseretyan
199996cbf9
Alerting: Resolve stale state + add state reason to notifications (#49352)
* adds a new reserved annotation `grafana_state_reason`
* explicitly resolve stale states
2022-09-21 13:24:47 -04:00
Guilherme Caulada
9c2f3045b4
PublicDashboards: Resolve interval for public dashboard data source (#55489)
* Resolve interval for public dashboard data source

* Remove type assertions in favor of 'in'

* Add org id to public dashboard requests
2022-09-21 13:29:27 -03:00
idafurjes
48a8b35ece
Chore: Add org methods to org service and store (#55579)
* Add org methods to org service and store

* Fix name of fake

* Remove unused fake

* Add xorm tags and half of a test

* Add cmment for clarifying missing part of test

* Add some comments about future refactors

* Rename test

* Add test for update org address
2022-09-21 18:00:18 +02:00
Jean-Philippe Quéméner
74c66b29d0
Alerting: Skip unsupported file types on provisioning (#55573) 2022-09-21 16:48:39 +02: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
Yuriy Tseretyan
0629d3922a
stop flushing state when Grafana stops (#55504) 2022-09-21 10:10:17 -04:00
Emil Tullstedt
647997cc4c
Alerting: Fix flaky test (#55551)
The length of the identifier from the underlying library is 9 or more characters depending on the rate at which the identifiers are generated. See https://pkg.go.dev/github.com/teris-io/shortid

The test previously made the assumption that the length will always be 10, which would intermittently fail.
2022-09-21 14:17:25 +02:00
ying-jeanne
7b4cea8151
Chore: StoreSplit tag service (#55453)
* move tag service outside

* fix dashboard

* fix test

* lint

* fix linter

* remove spew
2022-09-21 08:04:01 -04:00
Will Browne
b25ea75bac
Plugins: Add secure JSON fields to plugin setting DTO (#55313)
* add secure JSON fields to plugin setting DTO

* add nil pointer fix

* adding secureJsonFields to the plugin meta.

Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
2022-09-21 12:20:11 +02:00