Commit Graph

6638 Commits

Author SHA1 Message Date
Sofia Papagiannaki
c19d65b1ad
Alerting: some fixes for updating rules via the API (#38764)
* Alerting: Allow updating rules if quota are exceeded

* Check for rule UID uniqueness in POST request
2021-09-02 19:38:42 +03:00
gotjosh
dd502f22eb
Alerting: Fix alert flapping in the internal alertmanager (#38648)
* Alerting: Fix alert flapping in the alertmanager

fixes a bug that caused Alerts that are evaluated at low intervals (sub 1 minute), to flap in the Alertmanager.
Mostly due to a combination of `EndsAt` and resend delay.

The Alertmanager uses `EndsAt` as a heuristic to know whenever it should resolve a firing alert, in the case that it hasn't heard
back from the alert generation system.

Because grafana sent the alert with an `EndsAt` which is equal to the `For` of the alert itself,
and we had a hard-coded 1 minute re-send delay (only applicable to firing alerts) this meant that a firing alert would resolve in the Alertmanager before we re-notify that it still firing.

This commit, increases the `EndsAt` by 3x the the resend delay or alert interval (depending on which one is higher). The resendDelay has been decreased to 30 seconds.
2021-09-02 16:22:59 +01:00
Ryan McKinley
e461c722bf
Live: prepend orgId when publishing from HTTP (#38775) 2021-09-01 17:54:34 +02:00
Serge Zaitsev
643c7fa0cb
Chore: update all +build statements (#38782) 2021-09-01 17:38:56 +03:00
Alex Khomenko
ea8d9d77f4
Admin: User list tweaks (#38750)
* Setup filter

* Enable filtering users by active in last 30 days

* Add loading state

* Update last active age strings

* Tweak user list

* Use theme spacing

* Improve table's accessibility

* Add more aria-labels
2021-09-01 16:53:58 +03:00
Will Browne
e39410c094
Cloud-Monitoring: Ensure service gets dependencies (#38788)
* ensure cloud-monitoring gets service dependencies

* all one line
2021-09-01 15:29:21 +02:00
Gabriel MABILLE
9f29241a0c
AccessControl: add one-dimensional permissions to datasources (#38070)
* AccessControl: add one-dimensional permissions to datasources in the backend

* AccessControl: add one-dimensional permissions to datasources in the frontend (#38080)

Co-authored-by: Hugo Häggmark <hugo.haggmark@grafana.com>
2021-09-01 15:18:17 +02:00
Hugo Häggmark
55e20bbf04
LibraryPanels: Separates name from panel title (#38707)
* LibraryPanels: Separates name from panel title

* WIP

* Chore: fixes update for duplicate lib panels

* Chore: reverts implementation

* Chore: show library options only for library panels

* Chore: ui fixes after PR comments

* Chore: fixes issue when creating library panels
2021-09-01 13:27:43 +02:00
Joan López de la Franca Beltran
6cfb640a0b
Chore: Refactor securedata to remove global encryption calls from dashboard snapshots (#38714)
* Add encryption service

* Add tests for encryption service

* Inject encryption service into http server

* Replace encryption global function usage in login tests

* Migrate to Wire

* Move Encryption bindings to OSS Wire set

* Chore: Refactor securedata to remove global encryption calls from dashboard snapshots

* Fix dashboard snapshot tests

* Remove no longer user test

* Add dashboard snapshots service tests

* Refactor service initialization

* Set up dashboard snapshots service as a background service

Co-authored-by: Tania B <yalyna.ts@gmail.com>
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
2021-09-01 13:05:15 +02:00
Serge Zaitsev
c3ab2fdeb7
Macaron: remove custom Request type (#37874)
* remove macaron.Request, use http.Request instead

* remove com dependency from bindings module

* fix another c.Req.Request
2021-09-01 11:18:30 +02:00
Kai Hayashi
6e0f18b13a
CloudWatch: Update Period auto to take retention into account (#37424)
* now to get it to build

* modified names, added the 455 day case, and added a comment

* removed wireguard override i used for my local

* updated the docs
2021-09-01 09:44:47 +02:00
shuotli
f2c4346cc4
Azure Monitor: Add support for numeric fields in ARG (#38728)
* Fix todouble/toreal not working

* fix test
2021-09-01 09:02:08 +02:00
Dan Cech
681de1ea89
add key/value store service (#36868)
* add key/value store service

* don't export kvStoreSQL, consumers should interact with KVStore & NamespacedKVStore

* add del method, avoid ErrNotFound (#38627)

* switch value column to medium text

Co-authored-by: Alexander Emelin <frvzmb@gmail.com>
2021-08-31 11:05:45 -04:00
Tania B
6b7b9f5158
Chore: Remove global encryption calls from sqlstore (#38588)
* Add encryption service

* Add tests for encryption service

* Inject encryption service into http server

* Replace encryption global function usage in login tests

* Refactor UpdatePluginSetting

* Refactor EncryptSecureSettings

* Fix wire.go

* Refactor service initialization

Co-authored-by: Joan López de la Franca Beltran <joanjan14@gmail.com>
Co-authored-by: Joan López de la Franca Beltran <5459617+joanlopez@users.noreply.github.com>
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
2021-08-31 15:01:23 +02:00
Gábor Farkas
aa7a6633b8
old-alert: set interval and max-data-points (#38434)
* alerting: old-alerting: handle interval + maxdatapoints better

* fixed failing test

* refactor: use interval instead of tsdb

* fix typo

* added unit-test

* added comment

* refactor
2021-08-31 14:49:30 +02:00
Tania B
bfde29d107
Chore: Remove global encryption calls from authinfoservice (#38591)
* Add encryption service

* Add tests for encryption service

* Inject encryption service into http server

* Replace encryption global function usage in login tests

* Migrate to Wire

* Refactor authinfoservice to use encryption service

Co-authored-by: Joan López de la Franca Beltran <joanjan14@gmail.com>
Co-authored-by: Joan López de la Franca Beltran <5459617+joanlopez@users.noreply.github.com>
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
2021-08-31 14:00:13 +02:00
Ashley Harrison
7a242afcd6
Sidemenu: Refactor BottomNavLinks to use SideMenuDropDown (#38598)
* Sidemenu: Attempt to refactor BottomNavLinks to use SideMenuDropDown

* BottomNavLinks: Rewrite existing enzyme tests in RTL

* BottomNavLinks: Use object spreading instead of slicing
2021-08-31 10:37:51 +01:00
Selene
e47a60f511
Add filter to search users by active (#38637)
* Add filter to search users by active

* Fix query
2021-08-31 11:35:16 +02:00
Dimitris Sotirakis
8e2ee0a1c8
Chore: Update to Golang 1.17 (#38608)
* Update to golang 1.17

* Further updates

* Run go mod tidy on go 1.17

* Apply suggestions from code review

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>

* Use build-container:1.4.2

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-08-31 09:19:26 +03:00
Tania B
a0108a1e5b
Encryption: Extract encryption into service (#38442)
* Add encryption service

* Add tests for encryption service

* Inject encryption service into http server

* Replace encryption global function usage in login tests

* Apply suggestions from code review

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

* Migrate to Wire

* Undo non-desired changes

* Move Encryption bindings to OSS Wire set

Co-authored-by: Joan López de la Franca Beltran <joanjan14@gmail.com>
Co-authored-by: Joan López de la Franca Beltran <5459617+joanlopez@users.noreply.github.com>
Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
2021-08-30 19:39:55 +02:00
Serge Zaitsev
d15cbe4b4e
Macaron cleanup (#37795)
* simplify some dependency injection in macaron
* remove unused internal server error handler from macaron
* remove internal server error handler from the router
* remove unused combo router api
* remove unused parts of the macaron router
2021-08-30 11:48:34 +02:00
knuzhdin
3df001db93
ImageRendering: fix leakage of the rendering inflight counter (#34607) 2021-08-28 09:05:03 +02:00
Ikko Ashimine
202f295e51
Chore: Fix typo in nodes.go (#38636)
commmon -> common
2021-08-27 14:57:41 +02:00
Alexander Emelin
a95a40d87d
Live: allow connections with request host matching origin host (#38538) 2021-08-27 13:26:28 +03:00
Andres Martinez Gotor
b25eb0aa74
AzureMonitor: Fix wrong merge (#38623) 2021-08-27 11:31:17 +02:00
idafurjes
568549e810
Bug: Return empty plugins.DataTimeSeriesSlice when the frame field vector is epmty (#38587)
* Add check if the vector is empty

* Use Rows() instead of Len() on field

* Remove redundant condition
2021-08-26 16:39:50 +02:00
Stephanie Hingtgen
785072086c
Add event after datasource create (#38467)
* Add event after datasource create
2021-08-26 08:50:05 -05:00
Kevin Minehart
1ced2bc6df
move main.go logic out of commands (#38555)
* move main.go logic out of commands
2021-08-26 15:42:22 +02:00
Marcus Efraimsson
2f07af1b54
Chore: Skip test TestDevenvDashboardValidity for now (#38577)
Skipping TestDevenvDashboardValidity test for now to resolve broken 
test-backend step in main/branches. Did also run scripts/stripnulls.sh 
hence the devenv dashboard changes.
2021-08-26 11:45:57 +02:00
Marcus Efraimsson
ec88295a0b
Testdata: Fix proper initialization (#38576)
Fixes #38566
2021-08-26 11:39:04 +02:00
Dimitris Sotirakis
12320dda3c
Elasticsearch: Fix metric names for alert queries (#38546)
* Export fieldName to var

* Add empty string as frame name
2021-08-26 09:20:38 +02:00
idafurjes
7faea40674
API: Add short url validation (#38436)
* Add short url validation
Path should not contain string ../

* Update pkg/api/short_url.go

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-08-26 09:07:27 +02:00
Arve Knudsen
78596a6756
Migrate to Wire for dependency injection (#32289)
Fixes #30144

Co-authored-by: dsotirakis <sotirakis.dim@gmail.com>
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Ida Furjesova <ida.furjesova@grafana.com>
Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
Co-authored-by: Leon Sorokin <leeoniya@gmail.com>
Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
Co-authored-by: spinillos <selenepinillos@gmail.com>
Co-authored-by: Karl Persson <kalle.persson@grafana.com>
Co-authored-by: Leonard Gram <leo@xlson.com>
2021-08-25 15:11:22 +02:00
sam boyer
e61bc33163
Move dashboard scuemata to grafana-schema (#38470)
* Relocate dashboard scuemata to grafana-schema

* Update assorted tests, vars with dashboard path

* Remove crufty commented var

* Not sure...why that failed

* Remove prefix from base dashboard path var

* Move cue/ui remnants into grafana-schema

* Update import paths in plugin models

* Remove mudball, add package statements

* Remove cuegen.sh

Wooooo we ain't got no codegen

* Revert "Remove mudball, add package statements"

This reverts commit 9bed3098f1.

* Tidy up all the cue files

* Move dashboard scuemata into scuemata/ subdir

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2021-08-25 06:55:04 -04:00
Witek Bedyk
65501cbad3
Licensing: Provide correct URL for AGPL license (#36917)
* Provide correct link for AGPL license

* Change LicenseURL to point go Grafana OSS page

* Keep utm_source query parameter

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
2021-08-25 10:43:43 +02:00
Will Browne
1618d5ad6f
use most appropriate func for registering core plugins (#38497) 2021-08-25 10:08:48 +02:00
Domas
2e8a7c1161
set basic auth for prometheus backend ds requests (#38496) 2021-08-25 10:05:17 +03:00
Gabriel MABILLE
f9273d0d37
AccessControl: Add a mock (#38515) 2021-08-24 20:12:48 +02:00
gotjosh
14a0519338
Alerting: Remove Multiorg alertmangaer from the top-level services (#38506)
Removes the registration of the multi-org alertmanager, it is started as a subservice of ngalerting.
2021-08-24 19:11:28 +02:00
gotjosh
2f27a5240b
Alerting: Fix flake on test receiver tests (#38511)
* Alerting: Fix flake on test receiver tests

* Make the actual result from the API be sorted

* Use the correct letters
2021-08-24 17:22:11 +01:00
Alex Khomenko
6e639f3c72
Admin: Update stats page UI (#38014)
* Add StatCard

* Style cards

* Update types

* Add tests

* Move stats tab into licencing

* Prevent UI jumps when loading stats

* Fix merge conflicts

* Revert docs format
2021-08-24 19:13:48 +03:00
David Parrott
7fbeefc090
Alerting: create wrapper for Alertmanager to enable org level isolation (#37320)
Introduces org-level isolation for the Alertmanager and its components.

Silences, Alerts and Contact points are not separated by org and are not shared between them.

Co-authored with @davidmparrott and @papagian
2021-08-24 11:28:09 +01:00
Karl Persson
7ebf4027a7
Access Control: refactor permission evaluator to be more flexible (#35996)
* add a more flexible way to create permissions

* update interface for accesscontrol to use new eval interface

* use new eval interface

* update middleware to use new eval interface

* remove evaluator function and move metrics to service

* add tests for accesscontrol middleware

* Remove failed function from interface and update inejct to create a new
evaluator

* Change name

* Support Several sopes for a permission


* use evaluator and update fakeAccessControl

* Implement String that will return string representation of permissions
for an evaluator

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

Co-authored-by: Emil Tullstedt <emil.tullstedt@grafana.com>
2021-08-24 11:36:28 +02:00
idafurjes
ccab9611cb
API: Add theme validation (#38432)
* Add theme validation

* Fix lint for const
2021-08-24 08:41:15 +02:00
Ivana Huckova
74fef637af
Prometheus: Use default POST method if no httpMethod provided (#38446)
* Prometheus: If no httpMethod, use default POST method

* Use http.MethodPost
2021-08-23 15:25:40 +02:00
idafurjes
769b7a5865
Bug: Register OpenTSDB with correct service name (#37581)
* Bug: Register OpenTSDB with correct service name

* USe Register instead of RegisterAndStart
2021-08-23 14:56:53 +02:00
Jeremy Price
9a71cec1f0
Access Control: Make the evaluator prefix match only (#38025)
* Make the evaluator prefix match only

* Handle empty scopes

* Bump version of settings read role

Co-authored-by: Karl Persson <kalle.persson@grafana.com>
2021-08-23 14:03:20 +02:00
idafurjes
b9a538aff0
Bug: Add check before delete org (#38056)
* Add check before delete org

* Fix comment

* Simpify check if signed in user belongs to the org

* Add check on login if user has and existing org
change error code to 400, when org can not be deleted

* Roll back last commit, regarding an different issue
2021-08-23 08:58:35 +02:00
Travis Patterson
32e11434da
Fire event after datasource delete (#38090) 2021-08-20 14:51:31 -06:00
Jason Stangroome
28784935b8
Sort notification channels alphabetically (#37426)
Even without the ability to control the sort order or to filter, this notably improves usability for long lists of notification channels.

Partially fixes #20067.
2021-08-19 22:49:14 +02:00