* remove /api/tsdb/query
* revert changes to alert rules
* regenerate spec based on 9.0.x
(cherry picked from commit abfc711c53)
Co-authored-by: Will Browne <wbrowne@users.noreply.github.com>
* Fix normalization of labels
* Move sorting so it actually has an effect
* fix lint error
Co-authored-by: Todd Treece <todd.treece@grafana.com>
(cherry picked from commit d2fefec306)
Co-authored-by: Andrej Ocenas <mr.ocenas@gmail.com>
GetImages does a `TOKEN IN` query for each token in the argument.
(cherry picked from commit 47a3ddd968)
Co-authored-by: George Robinson <george.robinson@grafana.com>
Makes debugging problems with alert screenshotting easier.
(cherry picked from commit 56f40bd413)
Co-authored-by: Joe Blubaugh <joe.blubaugh@grafana.com>
This commit enables Unified Alerting for open source and enterprise unless disabled in configuration.
(cherry picked from commit 3b7f871bf4)
Co-authored-by: George Robinson <george.robinson@grafana.com>
Tests that file bytes are correctly read from storage when an image is
available without a URL. Tests that not found and success cases are both
handled.
(cherry picked from commit d5a327f43d)
Co-authored-by: Joe Blubaugh <joe.blubaugh@grafana.com>
* Add validator for mute timing and make it provisionable
* Add tests to ensure prometheus validators are running and errors are propagated
* Internal API for manipulating mute timings
* Define and generate API layer
* Wire up generated code
* Implement API handlers
* Tests for golang layer
* Fix reference bug
* Fix linter and auth tests
* Resolve semantic errors and regenerate
* Remove pointless comment
* Extract out provisioning path param keys, simplify
* Expected number of paths
(cherry picked from commit 909ebcf979)
Co-authored-by: Alexander Weaver <weaver.alex.d@gmail.com>
* Preferences: Fix PUT for Navbar and Query History
* Update linting
* Fix linting
* Use models defined in preference package in preferences
* Remove white space
* Revert "Use models defined in preference package in preferences"
This reverts commit 6f7aa9f8d3.
(cherry picked from commit e25a49ff49)
Co-authored-by: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com>
Adds three functions:
`withStoredImages` iterates over a list of models.Alerts, extracting a stored image's data from storage, if available, and executing a user-provided function.
`withStoredImage` does this for an image attached to a specific alert.
`openImage` finds and opens an image file on disk.
Moves `store.Image` to `models.Image`
Simplifies `channels.ImageStore` interface and updates notifiers that use it to use the simpler methods.
Updates all pkg/alert/notifier/channels to use withStoredImage routines.
(cherry picked from commit 9e8efaa459)
Co-authored-by: Joe Blubaugh <joe.blubaugh@grafana.com>
Replaces the regexp with calls to strings.ReplaceAll and strings.Fields
for simplicity and improved performance.
Signed-off-by: Dave Henderson <dave.henderson@grafana.com>
(cherry picked from commit 1f85101787)
Co-authored-by: Dave Henderson <dave.henderson@grafana.com>
* grant data source reader to all users when running oss or enterprise
without license
* fix asserts in alerting tests
* add oss licensing service for test setup
* fix tests to pass in enterprise
* lint
* fix tests
* set setting.IsEnterprise flag for tests
Co-authored-by: Yuriy Tseretyan <yuriy.tseretyan@grafana.com>
(cherry picked from commit 1796a1d277)
Co-authored-by: Karl Persson <kalle.persson@grafana.com>
* If GroupMemver.Read.All permissions is not configured return no groups
* fix log
(cherry picked from commit 624f8ef40d)
Co-authored-by: Karl Persson <kalle.persson@grafana.com>
* Add IsServiceAccount to query
* test for excluding service accounts in query
* align test
* test update
* added logging
* should fix tests
* moved test to bottom
* add back setup function
* Remove IsServiceAccount from query
Instead use false for is_service_account
and when the time comes to implement service accounts
for team. we deal with it
* missed teamtest
* formatting