Commit Graph

8737 Commits

Author SHA1 Message Date
Levente Balogh
2bf37a0d35
Data Connections: Remove the placeholder for Recorded Queries (#53230)
* feat(Data Connections): remove the Recorded Queries tab

* chore: remove the Recorded Queries from the nav
2022-08-04 06:39:06 +00:00
sam boyer
b11f66b4bb
coremodels: Combine static and generic registries (#53246)
* Stop generating non-dynamic registry code

* Remove generic, errors, s/static/base/

* Sort during codegen, not runtime

* Not a method call

* Precisiate a comment

* Remove generic registry, fix assignability test
2022-08-04 00:04:54 +04:00
Sofia Papagiannaki
ae101bf935
Alerting: Fix migration (#53253) 2022-08-03 11:41:18 -04:00
Kyle Brandt
643d2bc890
Chore: Sql store split for legacy alerting (#52901)
Moves ~20 sqlstore methods for legacy alerting out of sqlstore (sqlstore.Store interface) and into alerting.
2022-08-03 11:17:26 -04:00
Sofia Papagiannaki
5fec6cc4f5
API: Fix snapshot responses (#52998)
* API: Fix response status when snapshots are not found

* API: Fix response status when snapshot key is empty

* Apply suggestions from code review
2022-08-03 10:31:23 -04:00
Jean-Philippe Quéméner
54217a2037
Alerting: set dashboard and panel id using annotations in provisioning api (#53221) 2022-08-03 16:05:32 +02:00
Ieva
610abc2af0
Access Control: Fix permission error during dashboard creation flow (#53214)
* remove permission check

* remove unneeded function
2022-08-03 16:39:20 +03:00
Giordano Ricci
09c4dbdb9f
Correlations: Add UpdateCorrelation HTTP API (#52444)
* Correlations: add UpdateCorrelation HTTP API

* handle correlation not found

* add tests

* fix lint errors

* add bad request to API spec

* change casing

* fix casing in docs

* fix tests

* update spec
2022-08-03 14:18:51 +01:00
Serge Zaitsev
8d36f71673
Chore: Remove apikey store methods from sqlstore (#53197)
* Chore: remove apikey store methods from sqlstore

* remove GetAPIKeys

* remove GetAllAPIKeys

* remove the rest of apikey from sqlstore
2022-08-03 08:13:05 -04:00
Gabriel MABILLE
00ff61cb9e
RBAC: Add an additional check on UserID before fetching the permissions (#53002)
* RBAC: add an additional check before fetching permissions

* Nit.

* Readd removed test

* change message
2022-08-03 11:06:06 +02:00
Harry Tennent
c56aae6f63
Docs: update annotations API docs to include required field (#52644)
* Update annotations.md

A minor change to include the required fields when creating a new annotation via the annotations API. The error message when fields are missing is not descriptive and there is no indication in the current documentation (that I can see anyway) that would indicate these fields are required.

* Update annotations.md

Update required json body fields to only include fields that are actually required.

* Add required field in Swagger

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
2022-08-03 08:01:25 +00:00
idafurjes
fab6c38c95
Chore: Split get user by ID (#52442)
* Remove user from preferences, stars, orguser, team member

* Fix lint

* Add Delete user from org and dashboard acl

* Delete user from user auth

* Add DeleteUser to quota

* Add test files and adjust user auth store

* Rename package in wire for user auth

* Import Quota Service interface in other services

* do the same in tests

* fix lint tests

* Fix tests

* Add some tests

* Rename InsertUser and DeleteUser to InsertOrgUser and DeleteOrgUser

* Rename DeleteUser to DeleteByUser in quota

* changing a method name in few additional places

* Fix in other places

* Fix lint

* Fix tests

* Chore: Split Delete User method

* Add fakes for userauth

* Add mock for access control Delete User permossion, use interface

* Use interface for ream guardian

* Add simple fake for dashboard acl

* Add go routines, clean up, use interfaces

* fix lint

* Update pkg/services/user/userimpl/user_test.go

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>

* Update pkg/services/user/userimpl/user_test.go

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>

* Update pkg/services/user/userimpl/user_test.go

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>

* Split get user by ID

* Use new method in api

* Add tests

* Aplly emthod in auth info service

* Fix lint and some tests

* Fix get user by ID

* Fix lint
Remove unused fakes

* Use split get user id in admin users

* Use GetbyID in cli commands

* Clean up after merge

* Remove commented out code

* Clena up imports

* add back )

* Fix wire generation for runner after merge with main

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
2022-08-02 16:58:05 +02:00
Serge Zaitsev
64488f6b90
Chore: split APIKey store (#52781)
* move apikey store into a separate service

* add apikey service to wire graph

* fix linter

* switch api to use apikey service

* fix provideservice in tests

* add apikey service test double

* try different sql syntax

* rolling back the dialect

* trigger drone

* trigger drone
2022-08-02 16:55:19 +02:00
Andres Martinez Gotor
43955bdebd
Azure Monitor: Early error if the client secret is not set (#53106) 2022-08-02 16:53:05 +02:00
Yuriy Tseretyan
718620c197
Alerting: Update forking request handlers to use the same errors (#52965)
* generalize error handling in forking request handlers
* remove MatchesBackend and change test to test Can
* add 404 to route specs
* change backendTypeByUID to getDatasourceByUID of expected type
* use common errors in api testing
* handle 401 in errorToResponse
* replace backend type error with "unexpected datasource type"
* update swagger spec
2022-08-02 09:33:59 -04:00
Joan López de la Franca Beltran
28e27e1365
Encryption: De-duplicate encryption code with extensible service (#52472)
* Encryption: De-duplicate encryption code with extensible service

* Fix Wire injections

* Fix tests

* Register reload handler
2022-08-02 15:08:09 +02:00
Ashley Harrison
4d47d7085b
don't show dashboards or starred items in navbar when unauthenticated (#53051) 2022-08-02 09:57:32 +01:00
Alexander Weaver
c50cbea0bb
Alerting: Extract alert rule diff logic into separate file with exported API (#53083)
* Refactor diff logic into separate file with exported API

* Fix linter complaint
2022-08-01 23:41:23 -05:00
Yuriy Tseretyan
5fb778814c
Alerting: Update rules version when folder title is updated (#53013)
* remove support for bus from scheduler
* rename event to FolderTitleUpdated and fire only if title has changed
* add method to increase version of all rules that belong to a folder
* update ngalert service to subscribe to folder title change event call data store and update scheduler
* add tests
2022-08-01 19:28:38 -04:00
Jeff Levin
b3f7deebda
fix audit log prefix for public dashboards (#53070) 2022-08-01 14:46:48 -08:00
Alexander Weaver
cc20f04860
Alerting: Increase alert rule operation perf by replacing subquery with threshold calculation (#53069)
* Replace subquery with threshold calculation

* Use offset/limit to account for orgs with large gaps in IDs

* Collapse into one statement

* Drop dead constants

* Revert to 2 query approach

* Drop unused consts again
2022-08-01 16:48:34 -05:00
Artur Wierzbicki
0d817987ec
Storage: move file quota check to service (#53058)
* Storage: move file quota check to service

* Fix tests
2022-08-01 22:53:44 +04:00
Jean-Philippe Quéméner
8fc8d00167
Alerting: Add file provisioning for text templates (#52952) 2022-08-01 20:50:03 +02:00
Jean-Philippe Quéméner
3d39594d75
Alerting: Add file provisioning for mute timings (#52936) 2022-08-01 14:19:33 -04:00
Jean-Philippe Quéméner
eab6365cf7
Alerting: Add file provisioning for notification policies (#52877) 2022-08-01 19:14:57 +02:00
Jean-Philippe Quéméner
d9cace4dca
Alerting: Add file provisioning for contact points (#51924) 2022-08-01 18:17:42 +02:00
Alexander Emelin
e791a4e576
Search: Move entity events to transaction (#52394) 2022-08-01 18:56:36 +03:00
Isabella Siu
52b57fdb1c
CloudWatch: add CloudWatchSynthetics namespace (#52956) 2022-08-01 10:19:02 -04:00
Konrad Lalik
f877f79bbc
Alerting: Show evaluation interval global limit warning (#52942)
Co-authored-by: George Robinson <george.robinson@grafana.com>
2022-08-01 15:01:14 +02:00
Andres Martinez Gotor
314eb5223f
CloudMonitoring: Remove link setting for SLO queries (#53031) 2022-08-01 14:53:09 +02:00
lean.dev
3395981d35
Chaging log level when secret is not found (#53007) 2022-08-01 09:25:24 -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
Konrad Lalik
54f2c056f5
Alerting: Configure alert manager data source as an external AM (#52081)
Co-authored-by: Jean-Philippe Quéméner <JohnnyQQQQ@users.noreply.github.com>
Co-authored-by: gotjosh <josue.abreu@gmail.com>
Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
2022-08-01 10:20:43 +02:00
Artur Wierzbicki
046a2602ff
Storage: optimize sql list operation (#53009) 2022-07-30 00:19:28 +04:00
Artur Wierzbicki
08dabfaffc
Storage: add global resources/system (#53000)
Co-authored-by: nmarrs <nathanielmarrs@gmail.com>
2022-07-29 15:58:47 -04:00
Selene
085ae014cd
Sync: Move ActiveTokenCount to a new service (#52991)
* Move ActiveTokenCount to a new service

* Fixing tests

* fix `RootSystem`

Co-authored-by: Artur Wierzbicki <artur.wierzbicki@grafana.com>
2022-07-29 16:30:46 +02:00
Sofia Papagiannaki
87004cc22d
API: Do not expose user input in datasource error responses (#52992) 2022-07-29 08:46:51 -04:00
Jo
ff1c294963
AzureAD: Don't copy claims around (#52950) 2022-07-29 10:17:07 +02:00
Ryan McKinley
197acd73c0
Storage: support git + github backed roots (#52192) 2022-07-28 23:26:44 -07:00
Artur Wierzbicki
273c37c27d
Previews: return an empty array, rather than a null, if a dashboard has no datasources (#52961) 2022-07-28 22:49:06 +04:00
Artur Wierzbicki
449acb56a9
Previews: fix dashboard.thumbnails.ds_uids migration (#52960) 2022-07-28 21:50:02 +04:00
Kevin Minehart
d567f199dd
CI: add the grabpl build-backend command into the repo (#52673)
* Move the grabpl build-backend command and clean it up a bit
2022-07-28 10:11:22 -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
Andrej Ocenas
d0e548c3e5
Prometheus: Add flag to compare streaming and buffered responses (#51711)
* Add flag to compare streaming and buffered

* Move log

* Fix lint

* Fix tests

* Remove debug logs
2022-07-28 14:26:51 +02:00
ismail simsek
2f9636e698
InfluxDB: move datasource health check to backend (#52668)
* Move datasource health check to backend

* Introduce healthcheck unit tests

* Remove unused method
2022-07-28 12:06:09 +02:00
Artur Wierzbicki
9e841ef21d
Storage: fix delete folder (#52860) 2022-07-28 12:27:26 +03:00
ying-jeanne
017e6771ce
fix the issue of annotation endpoint (#52907) 2022-07-27 16:35:27 -04:00
Ieva
0d324e931d
Access Control: Allow org admins to invite new users (#52894)
* allow org admins to invite new users to Grafana

* doc updates

* fix test
2022-07-27 17:37:27 +01:00
Kristina
6ecc420534
Revert "Explore: Add Mixed Datasource (#51605)" (#52889)
This reverts commit e2258120e7.
2022-07-27 10:17:31 -05:00
Andres Martinez Gotor
d66e178b66
Azure Monitor: Append /default to the resource URI if needed (#52884) 2022-07-27 16:49:51 +02:00
Kristina
e2258120e7
Explore: Add Mixed Datasource (#51605)
* Toggle on the mixed mode option

* Ensure switching to mixed gives existing query prev datasource

* WIP - Populate datasource when switching between mixed and not

* WIP - handle change from mixed

* Remove preimport filter, refine filter to work for queries

* WIP debugging datasource transition

* Ensure creating a new query gets target data source if switching with no matches between

* Add mixed datasource to rich history display

* Cleanup console logs, add relevant comments

* Add feature toggle for mixed datasource

* Fix Wrapper tests

* Fix tests!

* Fix test types and add feature tracking

* Remove unnecessary default, remove explore/mixed workarounds for D2E

* Move display text logic to mixed datasource file

* Add in the default query parameters to a generated empty query

* Condense some code

* Apply suggestions from code review

Co-authored-by: Giordano Ricci <me@giordanoricci.com>

Co-authored-by: Giordano Ricci <me@giordanoricci.com>
2022-07-27 09:40:59 -05:00
Jo
c2d3c90bc8
Auth: Implement Token URL JWT Auth (#52662)
* Auth: check of auth_token in url and resolve user if present

* check if auth_token is passed in url

* Auth: Pass auth_token for request if present in path

* no need to decode token in index

* temp

* use loadURLToken and set authorization header

* cache token in memory and strip it from url

* Use loadURLToken

* Keep token in url

* strip sensitive query strings from url used by context logger

* adapt login by url to jwt token

* add jwt iframe devenv

* add jwt iframe devenv instructions

* add access note

* add test for cleaning request

* ensure jwt token is not carried into handlers

* do not reshuffle queries, might be important

* add correct db dump location

* prefer set token instead of cached token

Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>

Co-authored-by: Karl Persson <kalle.persson@grafana.com>
Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
2022-07-27 16:10:47 +02:00
Sofia Papagiannaki
7ba076de10
Chore: Move swagger definitions to the handlers (#52643) 2022-07-27 09:54:37 -04:00
Andres Martinez Gotor
7505cf418b
Azure Monitor: Deprecate metricDefinition (#52793) 2022-07-27 15:26:32 +02:00
Isabella Siu
542b4f2431
CloudWatch: returnData should default to true (#52759) 2022-07-27 08:45:59 -04:00
Carl Bergquist
7825ad6aa3
Instrumentation: Collect database connection stats (#52797)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
2022-07-27 13:42:28 +02:00
Will Browne
6d066a7aa8
Plugins: Add validation for plugin manifest (#52787)
* add validation for plugin manifest

* no more semver checking

* undo go.mod changes

* undo go.mod changes

* only validate v2 fields where necessary

* remove manifest version field check
2022-07-27 12:56:52 +02:00
Giordano Ricci
9a06b00e92
Correlations: Add DeleteCorrelation HTTP API (#51801)
* Correlations: add DeleteCorrelation HTTP API

* fix error message copy

* add readonly check

* add source_uid in delete condition

* make path singular

* Revert "make path singular"

This reverts commit d15be89578e202e5cb64a3e964ee09521b72d87c.

* add tests

* fix lint errors

* fix lint errors

* change casing

* update spec

* Remove transaction

* change casing in param name in docs
2022-07-27 09:07:58 +01:00
Giordano Ricci
4b2144fe40
Correlations: change casing of *UID properties (#52836)
* Correlations: change casing of *UID properties

* add link to correlations HTTP API
2022-07-27 07:01:46 +01:00
Ryan McKinley
0235fc136c
Storage: allow public access to public files (#52849) 2022-07-26 20:37:35 -07:00
ying-jeanne
86283bb99e
Chore: Rename dashboardUID to dashboardUIDs in search endpoint and up… (#52766)
* Chore: Rename dashboardUID to dashboardUIDs in search endpoint and update doc

* make it backward compatible
2022-07-26 22:28:14 -04:00
ying-jeanne
7da0a6d3ce
Chore: Add dashboard UID as query parameter of Get annotation endpoint (#52764)
* Chore: Add dashboard uid as query parameter of Get annotation endpoint

* Update pkg/api/annotations.go

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>

* update the dashboarUID

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
2022-07-26 21:52:34 -04:00
Yuriy Tseretyan
a081764fd8
Alerting: Scheduler to use AlertRule (#52354)
* update GetAlertRulesForSchedulingQuery to have result AlertRule
* update fetcher utils and registry to support AlertRule
* alertRuleInfo to use alert rule instead of version
* update updateCh hanlder of ruleRoutine to just clean up the state. The updated rule will be provided at the next evaluation
* update evalCh handler of ruleRoutine to use rule from the message and clear state as well as update extra labels

* remove unused function in ruleRoutine
* remove unused model SchedulableAlertRule

* store rule version in ruleRoutine instead of rule
* do not call the sender if nothing to send
2022-07-26 09:40:06 -04:00
sam boyer
566d0a7148
coremodel: Fix hardcoded text and overly broad embedding (#52802)
* Replace hardcoded 'dashboard' references

* Only embed cue.mod/module.cue

* Add quotes
2022-07-26 09:14:07 -04:00
Carl Bergquist
732cc99480
instrumentation: add buckets to catch very slow requests (#51492)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
2022-07-26 12:38:59 +03:00
Torkel Ödegaard
284ec1d428
Profile: Fix nav tree link to notifications (#52685) 2022-07-26 10:11:40 +01:00
Ieva
b3a10202d4
Revert "Service accounts: Add service account to teams" (#52710)
* Revert "Service accounts: Add service account to teams (#51536)"

This reverts commit 0f919671e7.

* remove unneeded line

* fix test
2022-07-26 09:43:29 +01:00
ying-jeanne
ac502e5013
Chore: add dashboarduid in the connection endpoint response (#52761)
* Chore: add dashboarduid in the connection endpoint response

* add uid of dashboard in the markdown
2022-07-25 18:55:28 -04:00
Artur Wierzbicki
3cd43bd7ea
Storage: externalize allow_unsanitized_svg_upload (#52703) 2022-07-25 21:11:17 +04:00
Michael Mandrus
72d9de3a0f
Secrets: Implement Secret Plugin required flag and fatal crash on startup (#52552)
* add special handling on the plugin gathering side to check whether secrets manager plugins are enabled or not

* show disabled badge in front end if the plugin is not enabled

* Only show error in disabled badge hover if one is present (otherwise it shows "undefined")

* refactor to make use of fields already available in the DTO

* fix typo

* if there is no error returned for the plugin, just show 'disabled'

* fix typo

* Update public/app/features/plugins/admin/components/Badges/PluginDisabledBadge.tsx

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>

* Update frontendsettings.go

add clarifying comment

* fix unit test

* rework task to use new frontend property combined with plugin type to determine if the plugin should be disabled

* Update helpers.test.ts

revert test change

* fix unit test

* show custom uninstall message if the plugin is a secrets manager

* bogus commit to trigger precommit

* undo commit

* run precommit manually

* add some consts

* refactor a bit to pull plugin error management up a level

* re-add code squashed in merge

* fix compile issues

* add code to set plugin error fatal flag after secret migration

* refactor to move plugin startup out of Should Check func

* re-add important check

* make plugin startup errors fatal the first time we set a secret on the plugin

* rename func to make intent clearler

* remove unnecessary duplicate code from plugin mig

* fix compile error

* fix more compile errors

* add some extra logging to secrets migration

* have remote_plugin secret service managed plugin error fatal flag directly

* add blank file for eventual unit tests

* fix linting issues

* changes from PR review

* quick bit of cleanup

* add comment explaining design decision

* move more common test helpers to file

* slightly update to first time Get secret call

* add unit tests

* remove override func from provider

* fix linting issues

* add test cleanup step

* add some comments about refactoring to hacky test function

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2022-07-25 12:37:47 -04:00
Artur Wierzbicki
33fc3a683b
Datasources: add datasourceUids filter 2022-07-25 19:24:22 +04:00
Giordano Ricci
5ce4baf6f5
Correlations: Add CreateCorrelation HTTP API (#51630)
* Correlations: add migration

* Correlations: Add CreateCorrelation API

* Correlations: Make correlations work with provisioning

* Handle version changes

* Fix lining error

* lint fixes

* rebuild betterer results

* add a UID to each correlation

* Fix lint errors

* add docs

* better wording in API docs

* remove leftover comment

* handle ds updates

* Fix error message typo

* add bad data test

* make correlations a separate table

* skip readonly check when provisioning correlations

* delete stale correlations when datasources are deleted

* restore provisioned readonly ds

* publish deletion event with full data

* generate swagger and HTTP API docs

* apply source datasource permission to create correlation API

* Fix tests & lint errors

* ignore empty deletion events

* fix last lint errors

* fix more lint error

* Only publish deletion event if datasource was actually deleted

* delete DS provisioning deletes correlations, added & fixed tests

* Fix unmarshalling tests

* Fix linting errors

* Fix deltion event tests

* fix small linting error

* fix lint errors

* update betterer

* fix test

* make path singular

* Revert "make path singular"

This reverts commit 420c3d315e.

* add integration tests

* remove unneeded id from correlations table

* update spec

* update leftover references to CorrelationDTO

* fix tests

* cleanup tests

* fix lint error
2022-07-25 15:19:07 +01:00
Ieva
fc4fd47deb
change managed permissions for service accounts (#52709) 2022-07-25 15:02:25 +01:00
Shirley
7f73f65bcd
CloudWatch: Refactor tests to assert struct instead of marshalled json (#52024)
* CloudWatch: Refactor tests to assert struct instead of marshalled json

* apply linter suggestion

* Move false next to average
2022-07-25 05:48:09 -04:00
Artur Wierzbicki
d9db155394
Storage: Mime type detection (#52512)
* Storage: implement mime type detection

* lint
2022-07-25 11:30:20 +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
Will Browne
843ff932b7
Plugins: Add signature wildcard globbing for dedicated private plugin type (#52163)
* it's glob time

* add more tests

* fix warn log

* support new sig type
2022-07-22 10:48:16 +02:00
Torkel Ödegaard
5b275ca3f5
TopNav: Support for deeper nesting in section nav (#52562) 2022-07-22 10:42:41 +02:00
Gabriel MABILLE
8d938175f5
Fix anonymous access (#52615) 2022-07-22 10:35:26 +02:00
Vardan Torosyan
18867d6d78
Service account: Ensure that you can revert only service accounts which you can access (#52626)
* Service account: Ensure that you can revert only service accounts which you can access

* Remove prettier messup with docs

* Remove prettier messup with docs

* Prettier run
2022-07-22 10:35:01 +02:00
owensmallwood
cf86c696e0
Public Dashboards: Adds template variable validation for pubdash on the backend (#52566)
Validates template variables for pubdash on the backend when saving a public dashboard
2022-07-21 13:56:20 -06:00
Eric Leijonmarck
fb24ff3081
Auth: Add prometheus metrics for case insensitive ids (#52162)
* rename file

* add promstats for authinfostore every 4h

* add mixed cased users

* cherry pick and cleanup

* fix: query login,email instead of count()

* FIX: mysql missing alias to subquery

* fix: query working on mysql, sqllite3, and pg
2022-07-21 18:11:35 +01:00
Connor Lindsey
83c1756251
Tracing: Send tags, events, and references as raw json (#52245)
* Tracing: Send tags, events, and references as raw json

* Update tempo fixture
2022-07-21 10:00:47 -06:00
Todd Treece
b5d57c45e3
Plugins: Add support for HTTP logger (#46578) 2022-07-21 09:46:47 -04:00
gotjosh
d762de7aa7
Revert "Alerting: Add support for images in Line alerts (#50703)" (#52593)
This reverts commit 0af09b8c57.
2022-07-21 06:57:57 -04:00
George Robinson
0af09b8c57
Alerting: Add support for images in Line alerts (#50703) 2022-07-21 11:43:06 +02:00
gotjosh
b026f2bc5d
Alerting: Allow the webhook notifier to support a custom Authorization header (#52515)
* Allow the webhook notifier to support a custom Authorization header

Instead of doing something clever of re-using the existing username/password fields of Basic Authentication - I opted for two diffent fields to match the upstream Alertmanager configuration (that in turn is based of the HTTP Basic authentication).

 It'll fail if you have values for both HTTP Basic Authentication and Authorization.
2022-07-21 10:25:58 +01:00
Ieva
f9ef7cac11
allow setting team managed permissions for service accounts (#52467) 2022-07-20 20:27:41 +02:00
Jean-Philippe Quéméner
ba9c18d9c3
Alerting: use static channel configuration to determinate secure fields (#52527)
* Alerting: use static channel configuration to determinate secure fields

* move to channels package

* introduce channel_config package to fix cyclic import

* add missing changes

* compare type to type
2022-07-20 19:58:36 +02:00
Torkel Ödegaard
77f7e8dafc
PageLayouts: Updates dashboard section routes with navId (#52175)
* First stab at new page layouts behind feature toggle

* Simplifying PageHeader

* Progress on a new model that can more easily support new and old page layouts

* Progress

* rename folder

* Progress

* Minor change

* fixes

* Fixing tests

* Make breadcrumbs work

* Add tests for old Page component

* Adding tests for new Page component and behavior

* fixing page header test

* Fixed test

* Moving user profile routes to navId

* PageLayouts: Updates dashboards routes with navId

* added missing navId

* AppChrome outside route

* Renaming folder

* Minor fix

* Updated

* Fixing StoragePage

* Updated

* Updating translation ids

* Updated snapshot

* update nav translation ids (yes this is confusing)

Co-authored-by: Ashley Harrison <ashley.harrison@grafana.com>
Co-authored-by: joshhunt <josh@trtr.co>
2022-07-20 17:26:52 +02:00
Jean-Philippe Quéméner
320262c3db
Alerting: Cleanup the alert_configuration table on write (#51497) 2022-07-20 16:54:18 +02:00
Jean-Philippe Quéméner
50ae42130b
Alerting: take datasources as external alertmanagers into consideration (#52534) 2022-07-20 16:50:49 +02:00
Jo
5c4aa4a7ac
OAuth: Allow role mapping from GitHub and GitLab groups (#52407)
* OAuth: Add extract role support to github

OAuth: correct github errors

Oauth: add github tests

Oauth: Allow mapping via group memberships

Oauth: Add markdown instructions to the new mappers

fix lint

* Apply suggestions from code review

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
Co-authored-by: Vardan Torosyan <vardants@gmail.com>

* Apply suggestions from code review

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
Co-authored-by: Vardan Torosyan <vardants@gmail.com>
2022-07-20 10:32:04 -04:00
Sofia Papagiannaki
f7c5eceb21
Chore: Update to the latest grafana-plugin-sdk-go and more swagger fixes (#52445)
* Fix get legacy alert response

* Swagger: Fix get folder by UID response

* Fix conflicting swagger model Alert

Reanme legacy alerting swagger model to LegacyAlert to differentiate it
from the prometheus Alert

* Bump grafana-plugin-sdk-go

* Fix get folder response

* Use go-swagger command for merging the specifications and remove merge_specs script
2022-07-20 16:09:42 +03:00
idafurjes
d3d8fdd878
Chore: Move user errors to user service (#52460)
* Move user not found err to user service

* User ErrCaseInsensitive from user pkg

* User ErrUserAlreadyExists from user pkg

* User ErrLastGrafanaAdmin from user pkg

* Remove errors from model
2022-07-20 14:50:06 +02:00
owensmallwood
3bc13e2335
Public Dashboards: Add Public Tag to Dashboard Title (#52351)
Adds Public tag to dashboard title when it has an enabled public dashboard
2022-07-19 17:44:41 -06:00
Michael Mandrus
acd85314b3
Secrets: Add logging to track secrets migration (#52481)
* add logging to track migration

* fix lint problem
2022-07-19 16:36:51 -04:00
Yuriy Tseretyan
79d92aa03e
Alerting: Rename sender.Sender to sender.ExternalAlertmanagers (#52463) 2022-07-19 14:04:48 -04:00
Isabella Siu
146c90d59e
CloudWatch: fix log explorer context (#52118) 2022-07-19 13:59:30 -04:00
lean.dev
e1785f4eb4
Secret migration from Sql KV Store to Secret Plugin (#52191)
* Created PluginSecretMigrationService to be able to migrate from the secrets table from the database to the secret plugin. Added migration which takes all the secrets at the sql store and stores it in the plugin. Then deletes all the secrets from the sql
* Added secretsKVStoreSQL.GetAll() method to return all the secrets at the sql table
* Renaming kvstore_test.go as sql_test.go, adding GetAll test case. Fixing decryption of keys
2022-07-19 14:42:23 -03:00
George Robinson
094dfd0d4d
Alerting: Fix Slack push notifications (#52391)
This commit fixes push notifications for Slack which used to show "This content cannot be displayed". The text field is shown in both the message and the push notification.
2022-07-19 17:42:24 +01:00
Ryan McKinley
3bdec4d138
Storage: remove orgId from sql config (#52426) 2022-07-19 08:13:26 -07:00
Ezequiel Victorero
e0a58300ac
Public Dashboards: count public dashboards view requests (#52419) 2022-07-19 11:50:37 -03:00
Artur Wierzbicki
0300b1c674
Storage: branding access (#52412)
* Storage: add special users for system branding access

* Storage: explicit global org id

* Storage: initialize org storages with global org id

* Storage: add comments

* Storage: simplify - use orgId: 1 for systembranding
2022-07-19 18:47:11 +04:00
idafurjes
c061b66d5f
Chore: Split delete user method (#52216)
* Remove user from preferences, stars, orguser, team member

* Fix lint

* Add Delete user from org and dashboard acl

* Delete user from user auth

* Add DeleteUser to quota

* Add test files and adjust user auth store

* Rename package in wire for user auth

* Import Quota Service interface in other services

* do the same in tests

* fix lint tests

* Fix tests

* Add some tests

* Rename InsertUser and DeleteUser to InsertOrgUser and DeleteOrgUser

* Rename DeleteUser to DeleteByUser in quota

* changing a method name in few additional places

* Fix in other places

* Fix lint

* Fix tests

* Chore: Split Delete User method

* Add fakes for userauth

* Add mock for access control Delete User permossion, use interface

* Use interface for ream guardian

* Add simple fake for dashboard acl

* Add go routines, clean up, use interfaces

* fix lint

* Update pkg/services/user/userimpl/user_test.go

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>

* Update pkg/services/user/userimpl/user_test.go

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>

* Update pkg/services/user/userimpl/user_test.go

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>

* Add wrapper for not service account error

* fix indentation

* Use fmt for error wrapper

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
2022-07-19 16:01:05 +02:00
Ieva
39025bb4cd
add logs to debug failing migration (#52447) 2022-07-19 09:34:49 -04:00
Yuriy Tseretyan
054fe54b03
Alerting: Split Scheduler and AlertRouter tests (#52416)
* move fake FakeExternalAlertmanager to sender package
* move tests from scheduler to router
* update alerts router to have all fields private
* update scheduler tests to use sender mock
2022-07-19 09:32:54 -04:00
Sofia Papagiannaki
e6b9ded949
API: Add service account routes to the swagger (#52398)
* API: Add service account routes to the swagger
2022-07-19 12:52:51 +03:00
Joe Blubaugh
a0f96ed4e1
SQLStore: Support Upserting multiple rows. (#52228)
This will be used to reduce write load when the alerting system writes a
large number of events.
2022-07-19 16:42:48 +08:00
Peter Holmberg
e74c2390de
Alerting: Prevent evaluation if "for" shorter than "evaluate" (#51797)
Co-authored-by: Armand Grillet <armand.grillet@outlook.com>
2022-07-19 10:30:26 +02:00
Gabriel MABILLE
2617a25fb5
Fix: Use ac.parameter for the scope protecting plugins routes (#52389)
* Fix: Use parameter for the scope protecting /a routes

* Fix: Use parameter for the scope protecting /plugins/resources routes
2022-07-19 09:30:54 +02:00
Joey Tawadrous
11b743ecd9
Traces: Remove serviceMap feature flag (#52375)
* Remove serviceMap feature flag

* Remove import

* Add serviceMap to queryTypeOptions
2022-07-19 08:00:58 +01:00
Gábor Farkas
46eec85b1a
loki: better handle an empty-response (#52397) 2022-07-19 08:13:38 +02:00
Ryan McKinley
824f12a993
Storage: Remove storageLocalUpload flag (#52413) 2022-07-18 10:44:42 -07:00
Artur Wierzbicki
841e5ae8ad
Storage: system/branding storage (#51987)
* Storage: add `system` branding storage root, expose `system/branding` subfolder

* Storage: merge
2022-07-18 19:37:22 +04:00
George Robinson
e7feff6d99
Alerting: Move debug log line to where alert rules are updated (#52318) 2022-07-18 11:27:06 -04:00
Ryan McKinley
b3b64e24c2
Export: include section count in status updates (#52368) 2022-07-18 11:03:08 -04:00
Artur Wierzbicki
9afe845d5c
Sanitization: fix log message (#52401) 2022-07-18 06:46:57 -07:00
idafurjes
f5cace8bbd
Rename Acl to ACL (#52342)
* Rename Acl to ACL

* Fix yaml files

* Add xorm tags and fix test
2022-07-18 15:14:58 +02:00
Artur Wierzbicki
b2736ac1fe
Storage: limit the number of uploaded files (#50796)
* #50608: sql file upload quotas

* rename `files_in_sql` to `file`

* merge conflict
2022-07-18 15:24:39 +04:00
Artur Wierzbicki
67ea2da57e
Storage: fix svg upload (#52395) 2022-07-18 06:36:54 -04:00
Sofia Papagiannaki
fb379ae436
Chore: Introduce playlist service (#52252)
* Store: Introduce playlist service

* Integrate playlist service

* Update swagger
2022-07-18 05:26:35 -04:00
Joe Blubaugh
689ae96a0e
Alerting: Refactor API types generation with different names. (#51785)
This changes the API codegen template (controller-api.mustache) to simplify some names. When this package was created, most APIs "forked" to either a Grafana backend implementation or a "Lotex" remote implementation. As we have added APIs it's no longer the case. Provisioning, configuration, and testing APIs do not fork, and we are likely to add additional APIs that don't fork.

This change replaces {{classname}}ForkingService with {{classname}} for interface names, and names the concrete implementation {{classname}}Handler. It changes the implied implementation of a route handler from fork{{nickname}} to handle{{nickname}}. So PrometheusApiForkingService becomes PrometheusApi, ForkedPrometheusApi becomes PrometheusApiHandler and forkRouteGetGrafanaAlertStatuses becomes handleRouteGetGrafanaAlertStatuses

It also renames some files - APIs that do no forking go from forked_{{name}}.go to {{name}}.go and APIs that still fork go from forked_{{name}}.go to forking_{{name}}.go to capture the idea that those files a "doing forking" rather than "are a fork of something."

Signed-off-by: Joe Blubaugh <joe.blubaugh@grafana.com>
2022-07-18 03:08:08 -04:00
Joan López de la Franca Beltran
9abe9fa702
Encryption: Expose secrets migrations through HTTP API (#51707)
* Encryption: Move secrets migrations into secrets.Migrator

* Encryption: Refactor secrets.Service initialization

* Encryption: Add support to run secrets migrations even when EE is disabled

* Encryption: Expose secrets migrations through HTTP API

* Update docs

* Fix docs links

* Some adjustments to makes errors explicit through HTTP response
2022-07-18 08:57:58 +02:00
Artur Wierzbicki
6188526e1d
Storage: use static access rules (#52334)
* Storage: use static access rules

* Storage: use static access rules

* Storage: add tests
2022-07-17 22:41:54 +04:00
Scott Lepper
53933972b6
mysql query editor - angular to react (#50343)
mysql conversion to react

Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
2022-07-15 16:49:24 -04:00
Yuriy Tseretyan
6e1e4a4215
Alerting: Update DbStore to use disabled orgs from the config (#52156)
* update DbStore to use UnifiedAlerting settings
* remove disabled orgs from scheduler and use config in db store instead
* remove test
2022-07-15 14:13:30 -04:00
Joan López de la Franca Beltran
7b40322bbe
Encryption: Add support to run secrets migrations even when EE is disabled (#51705)
* Encryption: Move secrets migrations into secrets.Migrator

* Encryption: Refactor secrets.Service initialization

* Encryption: Add support to run secrets migrations even when EE is disabled

* Init EE providers on-demand (only when needed)

* Add multiple tests + some adjustments

* Apply feedback
2022-07-15 18:33:34 +02:00
Yuriy Tseretyan
a7509ba18b
Alerting: rule evaluation loop's update channel to provide version (#52170)
* handler for update message in rule evaluation routine ignores the message if its version greater or equal.
* replace messages to update the channel if it is not empty
2022-07-15 12:32:52 -04:00
idafurjes
17ec9cac83
Add delete user from other services/stores (#51912)
* Remove user from preferences, stars, orguser, team member

* Fix lint

* Add Delete user from org and dashboard acl

* Delete user from user auth

* Add DeleteUser to quota

* Add test files and adjust user auth store

* Rename package in wire for user auth

* Import Quota Service interface in other services

* do the same in tests

* fix lint tests

* Fix tests

* Add some tests

* Rename InsertUser and DeleteUser to InsertOrgUser and DeleteOrgUser

* Rename DeleteUser to DeleteByUser in quota

* changing a method name in few additional places

* Fix in other places

* Fix lint

* Fix tests

* Rename DeleteOrgUser to DeleteUserFromAll

* Update pkg/services/org/orgimpl/org_test.go

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>

* Update pkg/services/preference/prefimpl/inmemory_test.go

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>

* Rename Acl to ACL

* Fix wire after merge with main

* Move test to uni test

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
2022-07-15 18:06:44 +02:00
Will Browne
5d052be6ff
Plugins: Always validate root URL if specified in signature manfiest (#52332)
* always validate root URL if specified in signature

* tidy imports
2022-07-15 17:42:20 +02:00
George Robinson
91fd0223a4
Datasources: Allow configuration of the TTL (#52161) 2022-07-15 10:48:52 +01:00
Jo
f3ee57abef
Fix: Choose Lookup params per auth module (#395) (#52312)
Co-authored-by: Karl Persson <kalle.persson@grafana.com>

Fix: Prefer pointer to struct in lookup

Co-authored-by: Karl Persson <kalle.persson@grafana.com>

Fix: user email for ldap

Co-authored-by: Karl Persson <kalle.persson@grafana.com>

Fix: Use only login for lookup in LDAP

Co-authored-by: Karl Persson <kalle.persson@grafana.com>

Fix: use user email for ldap

Co-authored-by: Karl Persson <kalle.persson@grafana.com>

fix remaining test

fix nit picks
2022-07-15 10:21:09 +01:00
Ryan McKinley
da1701ce57
Dashboards: load from storage (#51949) 2022-07-14 15:36:17 -07:00
Joan López de la Franca Beltran
973b3112d7
Encryption: Re-order error check (#52251) 2022-07-14 23:53:43 +02:00
Jean-Philippe Quéméner
41790083d2
Alerting: Add file provisioning for alert rules (#51635) 2022-07-14 23:53:13 +02:00
Yuriy Tseretyan
e5e8747ee9
Alerting: Update state manager to accept reserved labels (#52189)
* add tests for cache getOrCreate
* update ProcessEvalResults to accept extra lables
* extract to getRuleExtraLabels
* move populating of constant rule labels to extra labels
2022-07-14 15:59:59 -04:00
Matthew Jacobson
efa0d90093
Alerting: Fix Teams notifier not failing on 200 response with error (#52254)
Team's webhook API does not always use the status code to communicate errors.
There are cases where it returns 200 and an error message in the body.
For example, 429 - Too Many Requests or when the message is too large.
Instead, what we should be looking for is a response body = "1".

https://docs.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/connectors-using?tabs=cURL#send-messages-using-curl-and-powershell
2022-07-14 13:15:18 -04:00
Eric Leijonmarck
58a4122624
Fix: Comment out flaky tests for TestReadProm (#52243)
* comment out flaky test

* commented out unused functions

* using t.skip()

* disable linting
2022-07-14 17:42:13 +01:00
Ieva
c851907fc3
Access Control: Fix missing folder permissions (#52153)
* add the migration

* Update pkg/services/sqlstore/migrations/accesscontrol/dashboard_permissions.go

Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>

Co-authored-by: Eric Leijonmarck <eric.leijonmarck@gmail.com>
2022-07-14 12:01:21 -04:00
Kyle Brandt
05fd7eb047
SSE: Add noData type (#51973)
When there is a single frame with no fields (e.g. splunk datasource) SSE errors when trying to figure out the data type. This frame needs to exist since this is where the executedQueryString metadata exists.

This adds a new return type to SSE to represent no data, so the original frame with its metadata can still be maintained.
2022-07-14 09:18:12 -04:00
Adam Simpson
5d199a40b7
AzureMonitor: Update UI to experimental package (#52123)
* feat: make azure experimental the default

* feat: combine metrics query editor rows

fix: linter errors

* chore: remove test loop for DimensionFields test
2022-07-14 13:07:31 +00:00
Emil Tullstedt
c8b5307c61
Preferences: Get home dashboard from teams (#52225) 2022-07-14 08:20:11 -04:00
Michał Zielonka
b54da68765
Alerting: fix validation of alertmanager template. (#51538)
without setting function map from alertmanager we receive error:
method=PUT path=/api/v1/provisioning/templates/slack.message status=400
level=error msg="invalid object specification: invalid template: template: :1: function \"toUpper\" not defined"

So for validation we should use the same settings as alertmanager do
for templates internally.
2022-07-14 11:54:08 +02:00
George Robinson
34d45977ca
Alerting: Fix bug where state did not change between Alerting and Error (#52204)
This commit fixes a bug where the state did not change from Alerting to Error if the evaluation result returned an error, or from Error to Alerting if evaluations stopped returning errors.
2022-07-14 10:53:39 +01:00
Alexander Weaver
2d7389c34d
Alerting: Provisioning API respects global rule quota (#52180)
* Inject interface for quota service and create mock

* Check quota and return 403 if limit exceeded

* Implement tests for quota being exceeded
2022-07-13 17:36:17 -05:00
Ryan McKinley
5fe1068f81
Export: Export plugin settings (#52129) 2022-07-13 12:36:14 -07:00
Emil Tullstedt
06bd8b8e7a
CSRF: Fix additional headers option (#50629)
* CSRF: Fix additional headers option

* fix: type assertion on error fail on wrapped error

* Update pkg/middleware/csrf/csrf_test.go

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>

* update test

Co-authored-by: eleijonmarck <eric.leijonmarck@gmail.com>
2022-07-13 19:28:59 +01:00
Ryan McKinley
ab6cf9e94d
Storage: refactor readonly support (#52127) 2022-07-13 10:15:25 -07:00
Yuriy Tseretyan
429ed4b4ee
remove unused orgStore from scheduler (#52157) 2022-07-13 10:34:35 -04:00
Yuriy Tseretyan
0d4c503d3d
update Evaluator interface to accept context (#52151) 2022-07-13 10:21:11 -04:00
Michael Mandrus
9aa6ce2a50
Datasource: Propagate datasource secret decryption errors to the frontend (#52068)
* update decrypt secrets function signature and add secrets error handling

* remove a couple instances of unnecessary logging since errors are properly handled now

* add unit test

* fix linting issues
2022-07-13 09:27:03 -04:00
Emil Tullstedt
dd6d71ee4b
HTTP: Add function for using new style errors with fallback (#51627) 2022-07-13 13:14:28 +02:00
Sofia Papagiannaki
4ff0f006dd
SQLstore: Fix fetching an inexistent playlist response (#51962)
* SQLstore: Fix fetching and deleting an inexistent playlist

xorm's session.Get() does not return an error if the raw does not exist.
It returns a boolean instead.
The playlist `sqlstore.GetPlaylist()` used to check only the error and in case
of inexistent UID didn't return an error.
2022-07-13 13:00:03 +03:00
Sofia Papagiannaki
21632817c5
Alerting: Fix invalid swagger specification (#51907)
* Alerting: Fix invalid swagger specification

* Add make targets for validating the generated swagger spec
2022-07-13 12:34:54 +03:00
Sofia Papagiannaki
b3992df988
API: Do not validate/save legacy alerts when saving a dashboard if legacy alerting is disabled (#51883)
* API: Do not validate/save legacy alerts if legacy alerting is disabled

Co-authored-by: Ida Furjesova <ida.furjesova@grafana.com>
2022-07-13 12:33:28 +03:00
Michael Mandrus
dfc7a98d87
add comments (#52124) 2022-07-12 19:21:02 -04:00
owensmallwood
894e519406
Owensmallwood/pubdash panel blank when target has no datasource (#52115)
Fixes public dashboards bug. When panel targets have no datasource, the datasource on the panel can be a json object or a string and will get added to the targets for pubdash.
2022-07-12 17:01:08 -06:00
Yuriy Tseretyan
554ebd647b
Alerting: Refactor Evaluator (#51673)
* AlertRule to return condition
* update ConditionEval to not return an error because it's always nil
* make getExprRequest private
* refactor executeCondition to just converter and move execution to the ConditionEval as this makes code more readable.
* log error if results have errors
* change signature of evaluate function to not return an error
2022-07-12 16:51:32 -04:00
Guilherme Caulada
2d8a91a846
Secrets: Improve unified secrets migration and implement compatibility flag (#50463)
* Implement disableSecretsCompatibility flag

* Allow secret deletion right after migration

* Use dialect.Quote for secure_json_data on secret deletion

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>

* Set secure_json_data to NULL instead of empty json

* Run toggles_gen_test and use generated flag variable

* Add ID to delete data source secrets command on function call

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>

* Remove extra query to get datasource on secret deletion

* Fix linting issues with CHANGELOG.md

* Use empty json string when deleting secure json data

* Implement secret migration as a background process

* Refactor secret migration as a background service

* Refactor migration to be inside secret store

* Re-add secret deletion function removed on merge

* Try using transaction to fix db lock during tests

* Disable migration for pipeline debugging

* Try adding sleep to fix database lock

* Remove unecessary time sleep from migration

* Fix merge issue, replace models with datasources

* Try event listener approach

* Fix merge issue, replace models with datasources

* Fix linting issues with unchecked error

* Remove unecessary trainling new line

* Increase wait interval on background secret migration

* Rename secret store migration folder for consistency

* Convert background migration to blocking

* Fix number of arguments on server tests

* Check error value of secret migration provider

* Fix linting issue with method varaible

* Revert unintended change on background services

* Move secret migration service provider to wire.go

* Remove unecessary else from datasource service

* Move transaction inside loop on secret migration

* Remove unecessary GetServices function

* Remove unecessary interface after method removal

* Rename Run to Migrate on secret migration interface

* Rename secret migrations service variable on server

* Use MustBool on datasource secret migration

* Revert changes to GetDataSources

* Implement GetAllDataSources function

* Remove DeleteDataSourceSecrets function

* Move datasource secret migration to datasource service

* Remove unecessary properties from datasource secret migration

* Make DecryptLegacySecrets a private method

* Remove context canceled check on secret migrator

* Log error when fail to unmarshal datasource secret

* Add necessary fields to update command on migration

* Handle high availability on secret migration

* Use kvstore for datasource secret migration status

* Add error check for migration status set on kvstore

* Remove NewSecretMigrationService from server tests

* Use const for strings on datasource secrets migration

* Test all cases for datasources secret migrations

Co-authored-by: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com>
2022-07-12 17:27:37 -03:00
Yuriy Tseretyan
a6b1090879
Alerting: refactor scheduler and separate notification logic (#48144)
* Introduce AlertsRouter in the sender package, and move all fields and methods related to notifications out of the scheduler to this router.
* Introduce a new interface AlertsSender in the schedule package and replace calls of anonymous function `notify` inside the ruleRoutine to calling methods of that interface.
* Rename interface Scheduler in api package to ExternalAlertmanagerProvider, and replace scheduler with AlertRouter as struct that implements the interface.
2022-07-12 15:13:04 -04:00
Jo
c9c4fc604e
LDAP: Improve errors and documentation (#52111) 2022-07-12 11:11:09 -04:00
Adela Almasan
2f942c57e8
Storage: Optionally overwrite existing files (#52067)
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2022-07-12 09:13:57 -05:00
Joe Blubaugh
0cbc14961a
Alerting: Disable /api/admin/pause-all-alerts with Unified Alerting (#51895)
/api/admin/pause-all-alerts only takes effect for legacy alerts. This
change returns a 403 if it's called when legacy alerting is disabled.

Fixes #51729
2022-07-12 10:01:31 +03:00
Ryan McKinley
3003a48dc6
Export: include alerts, thumbnails, usage stats, and short urls (#51938) 2022-07-11 16:25:40 -07:00
Alexander Weaver
0e066dd5f8
Alerting: Allow filtering of contact points by name (#51933)
* Define query param and regenerate

* Add query struct for contact points

* Filter contact points by name in query

* Document that name filter is optional
2022-07-11 17:11:46 -05:00
Matthew Jacobson
28dd413c1d
Alerting: Add config disabled_labels to disable reserved labels (#51832)
* Alerting: Add config disabled_labels to disable reserved labels

[unified_alerting.reserved_labels]
disabled_labels

* Replace IsGrafanaFolderDisabled with more generic IsReservedLabelDisabled

* Simplify SchedulerCfg by including UnifiedAlertingSettings
2022-07-11 12:41:40 -04:00
Matthew Jacobson
434e94ef2b
Alerting: Update default route groupBy to [grafana_folder, alertname] (#50052)
* Alerting: Update default route groupBy to [grafana_folder, alertname]

Default group by for new routes and migrations is now [grafana_folder, alertname]
2022-07-11 12:24:43 -04:00
Sofia Papagiannaki
42f69a5e63
API: Add playlists endpoints to the swagger spec (#51918) 2022-07-11 17:12:22 +03:00
Torkel Ödegaard
4d4ab87bb6
Page: Update profile page components to use new navId (#51664) 2022-07-11 14:35:30 +02:00
Alexander Weaver
fce283d73e
Alerting: Add method to reset notification policy tree back to the default (#51934)
* Define route and run codegen

* Wire up HTTP layer

* Update API layer and test fakes

* Implement reset of policy tree

* Implement service layer test and authorization bindings

* API layer testing

* Be more specific when injecting settings
2022-07-08 16:23:18 -05:00
Adam Simpson
05cdef5004
CloudWatch: Remove simplejson in favor of 'encoding/json' (#51062) 2022-07-08 19:39:53 +00: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
1d2aa7c69b
Storage: add delete / deleteFolder / createFolder (#51887)
* delete / delete folder / create folder

* add backend tests

* implement force delete

* fix merge

* lint fix

* fix delete root folder

* fix folder name validation

* fix mysql path_hash issue

* Fix returning error
2022-07-08 22:23:16 +04:00
Alexander Weaver
d77731646c
Fix consistency errors and regenerate (#51935) 2022-07-08 10:33:43 -05:00
Artur Wierzbicki
c372b892ec
fix nil pointer dereference (#51978) 2022-07-08 19:27:53 +04:00
Stephanie Hingtgen
704a602d8c
FeatureFlags: omit metric when grafana cant run the feature (#51856) 2022-07-08 09:11:49 -06:00
ying-jeanne
56f3f3fe69
Chore: Remove the old log format (#51526)
* remove the old log format

* fix CI

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
2022-07-08 09:56:30 -05:00
Gabriel MABILLE
5975c4bc6d
RBAC: Allow app plugins access restriction (#51524)
* RBAC: Allow app plugins restriction

Co-authored-by: Kalle Persson <kalle.persson@grafana.com>

* Fix tests

* Imports

* WIP

* Adding RBAC to AppPluginsRoutes

* Switching middleware order

* Restrict access to resources

* Nit

* Cosmetic changes

* Fix fallback

* Moving declaration to HttpServer

Co-Authored-By: marefr <marcus.efraimsson@gmail.com>

Co-authored-by: Kalle Persson <kalle.persson@grafana.com>
Co-authored-by: marefr <marcus.efraimsson@gmail.com>
2022-07-08 13:24:09 +02:00
Ieva
0c33b9f211
Access control: Allow organisation admins to add existing users to org (#51668)
* check users with user add permission to access the invite endpoint

* undo unneeded changes

* tests and cleanup

* linting

* linting

* betterer

* betterer again

* fix prettier issue

Co-authored-by: jguer <joao.guerreiro@grafana.com>
2022-07-08 12:07:00 +01:00
Ieva
d85df0a560
Service Accounts: Managed permissions for service accounts (#51818)
* backend changes

* frontend changes

* linting

* nit

* import order

* allow SA creator to access the SA page

* fix merge

* tests

* fix frontend tests

Co-authored-by: alexanderzobnin alexanderzobnin@gmail.com
2022-07-08 05:53:18 -04:00
hannes-256
62b0a8bae6
LDAP: Allow specifying LDAP timeout (#48870)
* Allow specifying LDAP timeout

* Update docs/sources/auth/ldap.md

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>

* LDAP timeout: Add annotations; Make functions "private"

* Setting the default timeout if unspecified

* fix goimports lint issue

Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
Co-authored-by: jguer <joao.guerreiro@grafana.com>
2022-07-08 08:52:54 +02: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
owensmallwood
2aff83d4e1
Public Dashboards Bug: Permissions error on panel when using mixed datasource with Enterprise (#51930)
Fixes pubdash bug for enterprise when pubdash panel uses a mixed datasource
2022-07-07 15:58:11 -06:00
Ryan McKinley
5cb8010440
Export: support stopping exports (#51769) 2022-07-07 11:02:01 -07:00
ismail simsek
8deb17fdc4
Plugins: InfluxDB update time range query (#51833) 2022-07-07 19:55:51 +02:00
ismail simsek
3d68023606
Plugins: InfluxDB datasource - set epoch query param value as "ms" (#51651) 2022-07-07 13:02:20 -04:00
Vardan Torosyan
5eaba5b5b2
Service account: Update service accounts creation (#51848) 2022-07-07 17:32:56 +01:00
Agnès Toulet
ca80865bf1
Rendering: Fix user information when using render key (#50879)
* Rendering: Fix user information when using render key

* fix when render user ID is 0

* update fix

* improve fix

* add comment
2022-07-07 17:01:49 +02:00
Jguer
b79b53cbdb
JWT: Add JWT proxy setup devenv (#51731)
* JWT: Add JWT Auth devenv

* Auth: JWT allow retrieving login token

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>

* JWT: Add JWT Auth Proxy devenv

* JWT: Add instructions to readme

* JWT: Add JWT users

* JWT: Remove oauth users

* revert session changes, unnecessary

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
2022-07-07 10:28:04 -04:00
Jguer
db9f80a7a3
ServiceAccounts: Add Prometheus metrics service (#51831)
* ServiceAccounts: Add Prometheus metrics service

* add missing init in tests
2022-07-07 10:03:16 -04:00
idafurjes
ee88b44458
Do not check permissions while deleting external snapshot (#51897) 2022-07-07 15:15:39 +02:00
Jguer
9ab210a7d7
ServiceAccounts: Don't create new orgs for service accounts (#51819)
* Org: use constants for status codes

* ServiceAccounts: Avoid creating new orgs for service accounts

* Document createUserBehavior

* Update pkg/services/sqlstore/org_users_test.go

* add doc string to flag
2022-07-07 08:50:38 -04:00
Artur Wierzbicki
e96f67ae2e
Renderer: Add sanitize API (#50936)
* svg fun

* #50597: add proto

* #50597: add sanitizer methods

* #50597: add provider

* #50597: use sanitizer

* #50597: use sanitizer

* update grafana to match new api

* add comments

* add capability check

* add timing

* update sanitize path

* improve log message

* strings.HasPrefix rather than filepath.IsAbs

* filepath.Clean + filepath.ToSlash for windows

* read 404

* remove `path.clean` from `getPathAndScope`

* add resp body close

* remove unneeded prop

* Update pkg/services/rendering/rendering.go

Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>

* remove test files

* filepath.ToSlash correct wrapping

* filepath.ToSlash correct wrapping

* filepath.ToSlash comment

* compilation error

* lint fix

* fix error message

* Update pkg/services/rendering/rendering.go

Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>

* add `image/svg+xml` mime type

* refactored log

* refactored log

Co-authored-by: Agnès Toulet <35176601+AgnesToulet@users.noreply.github.com>
2022-07-07 15:32:18 +04:00
Joan López de la Franca Beltran
81753526bd
Encryption: Refactor secrets.Service initialization (#51091)
* Encryption: Refactor secrets.Service initialization
2022-07-07 09:48:25 +02:00
Torkel Ödegaard
935334cbda
Scene: POC for a future dashboard model and runtime (#50980)
* Playing around

* This is getting interesting

* Updates

* Updated

* Observable experiments

* This is tricky

* VizPanel panel renderer

* New model progress

* Maybe this could be something

* Updated

* Rename

* updates

* Updated

* Query runners? not sure

* Updated

* updates

* flex box layout starting to work

* Testing

* Tested an action

* Parent context sort of working

* Progress

* Progress

* Updated

* Starting to work

* Things are working

* Scene list, nested scene demo

* Progress on repeats

* Moving things

* Pretty big progress

* More things working

* Great progress

* Progress

* Name changing

* Minor tweaks

* Simplified sizing

* Move toggleDirection to SceneFlexLayout

* add feature flag (#50990)

* removed new useObservable hook

* Rename folder and feature toggle to scenes

* Caching scenes so you can go back to another scene without having to re-query data

* Fix issue with subs on re-mount

* Fixing test

* Added SceneCanvasText to play around with layout elements with size based on content

* Scene: Edit mode and component edit wrapper that handles selection  (#51078)

* First step for scene variables

* Started playing around with a scene edit mode

* Better way to set component

* Progress on edit mode

* Update

* Progress on edit mode

* Progress on editor

* Progress on editor

* Updates

* More working

* Progress

* Minor update

* removed unnessary file

* Moving things around

* Updated

* Making time range separate from time picker

* minor rename of methods

* The most basic variable start

* Minor renames

* Fixed interpolate issue if not found at closest level

* An embryo of event model and url sync handling

* Update url sync types

* Removed unnessary any type arg

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
2022-07-07 08:53:02 +02:00
Artur Wierzbicki
052132be46
Storage: simplify retrieving the file names from the response frame (#51805)
* add util method for storage list frame

* use go:embed

* remove enum
2022-07-07 10:47:05 +04:00
Jeff Levin
eacee08135
public dashboards: move into into its own service (#51358)
This PR moves public dashboards into its own self contained service including API, Service, Database, and Models. Routes are mounted on the Grafana HTTPServer by the API service at injection time with wire.go. The main  route that loads the frontend for public dashboards is still handled by the API package.

Co-authored-by: Jesse Weaver <jesse.weaver@grafana.com>
Co-authored-by: Owen Smallwood <owen.smallwood@grafana.com>
2022-07-06 17:51:44 -06:00
owensmallwood
0b4af38bfa
Public Dashboards: Query Caching (#51403)
* passes id and uid to PublicDashboardDatasource

* betterer results

* If for a public dashboard, return the PublicDashboardDataSource first or else getDatasourceSrv.get() will fail bc of no authed user.

Added some unit tests for resolving the uid from the many possible datasource types.

* updates betterer

* Exports DashboardService. Adds method to DashboardService to build anonymous user for use with public dashboards where there is no authed user. Adds method on dashboard_queries to get all dashboard uids from a dashboard.

* refactors to get unique datasource uids

* Adds tests for getting all unique datasource uids off a dashboard

* adds test for building anonymous user with read and query actions that are scoped to each datasource uid in the dashboard

* updates casing of DashboardService

* updates test case to have additional panel with a different datasource

* gives default interval to public dashboard data source
2022-07-06 12:42:39 -06:00
dingweiqings
119c13e666
Alerting: Add custom templated title to Wecom notifier (#51529)
* add custom title in wecom channel

* add wecom test case and setting config in ui

* Update pkg/services/ngalert/notifier/channels/wecom_test.go

Co-authored-by: Matthew Jacobson <JacobsonMT@gmail.com>

* change version in comment

* Update pkg/services/ngalert/notifier/available_channels.go

Co-authored-by: Matthew Jacobson <JacobsonMT@gmail.com>

* format

Co-authored-by: Matthew Jacobson <JacobsonMT@gmail.com>
2022-07-06 11:54:46 -04:00
Will Browne
40dff288cd
Plugins: Register management endpoints only when external managed is also false (#51802)
* Only define plugin install endpoints when catalog enabled

* add external check
2022-07-06 16:22:59 +02:00
Eric Leijonmarck
0f919671e7
Service accounts: Add service account to teams (#51536)
* Revert "Serviceaccounts: #48995

Do not display service accounts assigned to team (#48995)"

This reverts commit cbf71fbd7f.

* fix: test to not include more actions than necessary

* adding service accounts to teams - backend and frontend changes

* also support SA addition through the old team membership endpoints

* fix tests

* tests

* serviceaccounts permission tests

* serviceaccounts permission service tests run

* added back test that was removed by accident

* lint

* refactor: add testoptionsTeams

* fix a bug

* service account picker change

* explicitly set SA managed permissions to false for dash and folders

* lint

* allow team creator to list service accounts

Co-authored-by: IevaVasiljeva <ieva.vasiljeva@grafana.com>
2022-07-06 05:34:36 -04:00
Will Browne
ba9fc10a74
Only define plugin install endpoints when catalog enabled (#51788) 2022-07-06 05:13:20 -04:00
Ryan McKinley
4fa606c600
Export: save all dashboards to git (#48233) 2022-07-05 10:54:07 -07:00
Ryan McKinley
4a00c7ebde
Storage: Add basic file upload management (#50638) 2022-07-05 10:53:41 -07:00
Jean-Philippe Quéméner
4a76436be2
Altering: validate that the mute time intervals exist when updating routing tree (#51573)
* validate that the mute time intervals exist when updating routing tree

* run lint

* add tests
2022-07-05 13:09:17 -04:00
Alexander Weaver
b9c7eb1380
Alerting: Add method to provisioning API for obtaining a group and its rules (#51398)
* Generate shell for new route

* Propagate path parameters

* Implement route logic

* Add a couple simple tests

* Use NotFound error for not found, avoid returning pointer

* Regenerate
2022-07-05 11:53:50 -05:00
Jean-Philippe Quéméner
e64cde8727
Alerting: validate that the receiver exist when updating routing tree (#51561)
* Alerting: validate that the receiver exist when updating routing tree

* rename interface

* add missing file

* change constructor

* fix e2e tests

* only import package once

* add unit test for bug

* wording

* close response body

* Update pkg/services/ngalert/api/tooling/definitions/alertmanager_validation.go

* refactor to remove database roundtrip
2022-07-05 18:09:57 +02:00
idafurjes
578ab71ba9
Copy delete user permission to access control service (#51747)
* Copy delete user permission to access control service

* Update pkg/services/accesscontrol/database/database_test.go

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>

Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
2022-07-05 18:05:56 +02:00
Andrej Ocenas
bf334ab777
Prometheus: Small improvements to the custom client (#51709)
* Add suggestions

* Fix tests
2022-07-04 22:55:07 +02:00
Will Browne
0b40c8e51e
Plugins: Add missing asserts for Plugin Errors field (#51702)
* make sure to check plugin errors

* remove unused test
2022-07-04 11:03:50 +00:00
Joan López de la Franca Beltran
38bcd37fba
Encryption: Move secrets migrations into secrets.Migrator (#51014) 2022-07-04 12:17:21 +02:00
George Robinson
6844ac9879
Alerting: Change __alertScreenshotToken__ to __alertImageToken__ (#50771) 2022-07-04 06:05:36 -04:00
Jean-Philippe Quéméner
580c5b6ad2
Alerting: add YAML support for relative time range (#51694) 2022-07-04 06:03:34 -04:00
Ieva
75873d05d7
Access Control: Allow dashboard admins to query org users (#51652)
* allow dashboard admins to query org users

* rename one more variable
2022-07-04 10:43:06 +01:00
Andrej Ocenas
3df34fe064
Prometheus: Remove cache, pass headers in request, simplify client creation for resource calls and custom client (#51436)
* Remove cache, pass headers in request, simplify client creation

* Add test for http options creation
2022-07-04 11:18:45 +02:00
Sven Grossmann
b7e22c37a8
UsageStats: fixed elasticsearch version number to semver (#49054)
* UsageStats: fixed elasticsearch version number

- The version numbering was changed from plain numbers to a semver-ish approach

* added missing version assertion

* adapted tests
2022-07-04 11:08:01 +02: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
Ezequiel Victorero
03c13742ac
Public Dashboards: disable dev mode required (#51646) 2022-06-30 20:10:30 -03:00
Ezequiel Victorero
ab6a609c32
Public Dashboards: fix time settings store when updating (#51601)
* Public Dashboards: fix time settings store when updating
2022-06-30 13:30:01 -08:00
Emil Tullstedt
a14ca8fb62
Dependencies: Clean up gofrs/uuid (#51615)
* Dependencies: switch from gofrs/uuid to google/uuid

Co-authored-by: Jeff Levin <jeff@levinology.com>
2022-06-30 10:55:33 -08:00
George Robinson
d59db0b8e6
Alerting: Better metrics and renamed BrowserScreenshotService (#51564) 2022-06-30 17:47:23 +01:00
Yuriy Tseretyan
8b3b667a47
Alerting: Fix rule API to accept 0 duration of field For (#50992)
* make 'for' pointer to distinguish between missing field and 0
* set 'for' to -1 if the value is missing but not allow negative in the request + path -1 with the value from original rule
* update store validation to not allow negative 'for'
* update usages to use pointer
2022-06-30 11:46:26 -04:00
George Robinson
7fea330dc1
Alerting: Remove withStoredImage and change forEachFunc (#51384) 2022-06-30 15:27:57 +01:00
Kristin Laemmert
9de00c8eb2
chore/backend: move dashboard errors to dashboard service (#51593)
* chore/backend: move dashboard errors to dashboard service

Dashboard-related models are slowly moving out of the models package and into dashboard services. This commit moves dashboard-related errors; the rest will come in later commits.

There are no logical code changes, this is only a structural (package) move.

* lint lint lint
2022-06-30 09:31:54 -04:00
Ieva
31e8e17d2f
allow specifying auth style (#51233) 2022-06-30 10:27:31 +01:00
Andreas Gerstmayr
040cc5021c
Prometheus: Fix integer overflow in rate interval calculation on 32-bit architectures (#51508) 2022-06-30 11:06:47 +02:00
Eric Leijonmarck
c5089f1595
Service accounts: add usagestats for teams (#51585)
* remove enabled service account count

* add service account count in teams

* removed unnessecary comment
2022-06-30 11:05:49 +02:00
Emil Tullstedt
b45c71c9ca
Loki: Create component for sending logs to Loki (#51500) 2022-06-30 10:24:44 +02:00
Sofia Papagiannaki
a5924315f8
API: Fix failure to generate swagger specification due to missing binary (#51551)
* Fix swagger generation

Add installing binary as dependency to the target

* Some more fixes
2022-06-30 09:58:07 +03:00
Yuriy Tseretyan
739d3469bc
Chore: Update ConcreteLogger to implement gokit Logger interface (#51599) 2022-06-29 18:16:10 -04:00
George Robinson
fe797dcfdc
Alerting: Improvements to image package (#51576)
This commit makes a number of improvements to the image package:

- Improved comments
- Return the correct error when a dashboard does not exist
- Set a timeout in context.Context
2022-06-29 20:30:13 +01:00
Alexander Emelin
0caecfe298
sync routing tree with latest changes in Gin (#51541) 2022-06-29 19:05:57 +03:00
kay delaney
8053f770c1
Export: Fix export/import of dash with library panels (#49319) 2022-06-29 16:18:27 +01:00
Guilherme Caulada
d5185f8ab9
Secrets: Implement unified secrets short lived cache (#51275)
* Implement unified secrets short lived cache

* Improve debug logging for unified secrets cache

* Re-add decryption cache to sql secret kvstore

* Remove cache from remote secret store plugin

* Revert secret store helpers implementation

* Remove cache from secret store plugin struct

* Update secret store cache to implement interface

* Set secret store cache value on get

* Fix issues with sql secret store decryption cache

* Increase clean up interval on cached secret store
2022-06-29 12:00:24 -03:00
kay delaney
189b7f9c0b
LibraryElements: Delete invalid connections before deleting element (#50519) 2022-06-29 08:56:40 -04:00
Michael Mandrus
7ef21662f9
Plugins: Show that Secrets Manager Plugin is active in the UI (#50953)
* add special handling on the plugin gathering side to check whether secrets manager plugins are enabled or not

* show disabled badge in front end if the plugin is not enabled

* Only show error in disabled badge hover if one is present (otherwise it shows "undefined")

* refactor to make use of fields already available in the DTO

* fix typo

* if there is no error returned for the plugin, just show 'disabled'

* fix typo

* Update public/app/features/plugins/admin/components/Badges/PluginDisabledBadge.tsx

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>

* Update frontendsettings.go

add clarifying comment

* fix unit test

* rework task to use new frontend property combined with plugin type to determine if the plugin should be disabled

* Update helpers.test.ts

revert test change

* fix unit test

* bogus commit to trigger precommit

* undo commit

* run precommit manually

Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
2022-06-29 08:48:23 -04:00
Andrej Ocenas
2372501368
Prometheus: Remove middleware for custom headers (#51518) 2022-06-29 11:04:57 +02:00
George Robinson
ed56755dd7
Alerting: Remove duplicate error message (#51515) 2022-06-29 09:39:24 +01:00
Dan Keder
9595fd6b66
Prometheus: Support 1ms resolution intervals (#44707)
* Prometheus: Support 1ms resolution in time ranges

* UI: Support 1ms resolution in time ranges
2022-06-29 07:39:50 +02:00
Jguer
6d0261263c
ServiceAccounts: Add Service Account Token last used at date (#51446)
* ServiceAccounts Add api key last used at

* ServiceAccounts: LastUpdateAt tests
2022-06-28 16:42:40 +02:00
idafurjes
6c43eb0b4d
Split Create User (#50502)
* Split Create User

* Use new create user and User from package user

* Add service to wire

* Making create user work

* Replace user from user pkg

* One more

* Move Insert to orguser Service/Store

* Remove unnecessary conversion

* Cleaunp

* Fix Get User and add fakes

* Fixing get org id for user logic, adding fakes and other adjustments

* Add some tests for ourguser service and store

* Fix insert org logic

* Add comment about deprecation

* Fix after merge with main

* Move orguser service/store to org service/store

* Remove orguser from wire

* Unimplement new Create user and use User from pkg user

* Fix wire generation

* Fix lint

* Fix lint - use only User and CrateUserCommand from user pkg

* Remove User and CreateUserCommand from models

* Fix lint 2
2022-06-28 14:32:25 +02:00
Emil Tullstedt
7d815a1db5
Alerting: Use google/uuid instead of gofrs/uuid (#51242) 2022-06-28 11:57:24 +02:00
George Robinson
f04dfc589c
Alerting: Add support for images in Pushover alerts (#51372) 2022-06-28 09:40:01 +01:00
George Robinson
5053468c65
Alerting: Add support for images in Telegram (#51433) 2022-06-28 09:39:40 +01:00
Víctor Martínez Bevià
a7f1ca133e
Init legacy guardian when creating folder scenario (#50800) 2022-06-28 11:09:25 +03:00