After migrating to unified alerting, users must explicitly allow rolling
back to legacy alerting by setting force_migration = true in config.
This updates the panic message to clarify why that's required and what
the consequences of rolling back will be.
Fixes#50469
(cherry picked from commit 30f035ca34)
Co-authored-by: Joe Blubaugh <joe.blubaugh@grafana.com>
The ng_alert_notification email template did not include templating for
linked or embedded images. This change updates that.
Additionally, this change supports embedding an image for each alert in
an email batch.
Fixes#50315
(cherry picked from commit ecf080825e)
This PR renames the configuration key enabled to capture. This is needed as we already have a configuration key with the name enabled.
Fixes#50328
(cherry picked from commit fd664e4beb)
Co-authored-by: Jean-Philippe Quéméner <JohnnyQQQQ@users.noreply.github.com>
* Alerting: remove feature toggle for provisioning API
* remove missed code parts
* remove unused import
* remove empty line
* mark routes as stable
(cherry picked from commit 4b8a4449ed)
Co-authored-by: Jean-Philippe Quéméner <JohnnyQQQQ@users.noreply.github.com>
* Add migration
* Migrator: Extend support to rename columns
* Fix getting current key
* Fix column name in migration
* Fix deks reencryption
* Fix caching
* Add back separate caches for byName and byPrefix
* Do not concatenate prefix with uid
* Rename DataKey struc fields
* SQLStore: Add deprecation comments for breaking migrations
* Add comment
* Minor corrections
Co-authored-by: Joan López de la Franca Beltran <joanjan14@gmail.com>
(cherry picked from commit 4f8111e24e)
Co-authored-by: Tania <yalyna.ts@gmail.com>
* Alerting: only delete mute time if not used by route
* add a testcase
* import package only once
* replace apimodels with definitions
(cherry picked from commit 8de4ffe61f)
Co-authored-by: Jean-Philippe Quéméner <JohnnyQQQQ@users.noreply.github.com>
* Migrator: Extend support to rename columns
* SQLStore: Add deprecation comments for breaking migrations
(cherry picked from commit 5f1305d280)
Co-authored-by: Joan López de la Franca Beltran <5459617+joanlopez@users.noreply.github.com>
* update action names
* correctly retrieve teams for signed in user
* remove test
* undo swagger changes
* undo swagger changes pt2
* add migration from old action names to the new ones
* rename from list to read
* linting
* also update alertign actions
* fix migration
(cherry picked from commit 5dbea9996b)
Co-authored-by: Ieva <ieva.vasiljeva@grafana.com>
The image file upload code as it is now simply doesn't work - it's
missing several important steps in the file upload process. There is
more information in the fixed issue as to the steps required.
After this change, screenshots will still be attached to slack messages
when external image storage is used with Grafana (an S3 bucket, for
example).
Fixes#50056
(cherry picked from commit 9759eeda17)
Co-authored-by: Joe Blubaugh <joe.blubaugh@grafana.com>
* Alerting: Remove double quotes from matchers
With #38629 a new Alertmanager configuration object was introduced with `object_matchers`, it was meant to circumvent around the fact that Prometheus label names don't support a set of characters that Grafana needs to support for alerts, silences, matchers, etc. (with a common example being elasticsearch's `.`).
This new object does not include the label of sanitzation or validation that its Prometheus equivalent supports in `matchers` and therefore are semantically not equivalent.
This triggered the problem that when the migration is run, we use `matchers` as the object to populate in configuration for routing policies, but when the UI does its first save this object is transformed to `object_matchers`.
Matchers that were previously running just fine would immediately stop working as soon as the configuration is saved.
This problem surfaced with the introduction of #49952 where we stopped stripping double quotes from matchers (not just regex but _all_ of them).
* Add comment explaining rationale and future removal
Co-authored-by: Alex Weaver <weaver.alex.d@gmail.com>
(cherry picked from commit 1a50b0dbb7)
Co-authored-by: gotjosh <josue.abreu@gmail.com>
* 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>