These permissions could be created through the API but would not show
correctly in the UI.
(cherry picked from commit 5af96544f3)
Co-authored-by: Jesse Weaver <pianohacker@gmail.com>
* Alerting: Remove invalid Slack URL as we migrate notification channels (#40344)
* Alerting: Remove invalid Slack URL as we migrate notification channels
Grafana will accept any type of utf8 valid string as the Slack URL and will simply fail as we try to deliver the notification of the channel. The Alertmanager will fail to apply a configuration if the URL of the Slack Receiver is invalid.
This change takes that into account by removing the URL for the receiver as we migrate notification channels that do not pass the url validation. As we assume the notification was not being delivered to being with.
* Add a log line when we modify the channel
Co-authored-by: Yuriy Tseretyan <yuriy.tseretyan@grafana.com>
(cherry picked from commit 2448123a65)
* fix tests
Co-authored-by: gotjosh <josue@grafana.com>
Co-authored-by: Yuriy Tseretyan <yuriy.tseretyan@grafana.com>
* Alerting: Fixes a bug when trying to sync broken alertmanager config (#40338)
* Alerting: Fixes a bug when trying to sync broken alertmanager config
Broken alertmanager configuration has the potential to be introduced as part of a migration e.g. due to incompatible data between what grafana accepts and what the Alertmanager expects. When this happens, we expect an eventually consistent behaviour where we'll keep trying to apply the configuration until it works.
As part of change in https://github.com/grafana/grafana/pull/39237 we introduced a regression that modified this behaviour and instead tried to create a new Alertmanager for that organization everytime, which eventually ended up in a panic due to a duplicate metrics being registered.
This PR fixes that and introduces a test to catch further regressions.
* Remove disable orgs
(cherry picked from commit 48d73cb148)
* remove decryptFn that is not known in 8.2 branch
Co-authored-by: gotjosh <josue@grafana.com>
Co-authored-by: Yuriy Tseretyan <yuriy.tseretyan@grafana.com>
Remove validation for labels to be accepted in the Alertmanager, This helps with datasources that produce non-compatible labels.
Adds an "object_matchers" to alert manager routers so we can support labels names with extended characters beyond prometheus/openmetrics. It only does this for the internal Grafana managed Alert Manager.
This requires a change to alert manager, so for now we use grafana/alertmanager which is a slight fork, with the intention of going back to upstream.
The frontend handles the migration of "matchers" -> "object_matchers" when the route is edited and saved. Once this is done, downgrades will not work old versions will not recognize the "object_matchers".
Co-authored-by: Kyle Brandt <kyle@grafana.com>
Co-authored-by: Nathan Rodman <nathanrodman@gmail.com>
(cherry picked from commit 6572017ec7)
cleanup
Co-authored-by: gotjosh <josue@grafana.com>
* chore(Plugins/Admin): make the Plugins Catalog the default way to interact with plugins
* chore(defaults.ini): change the default value for `plugin_admin_enabled`
* test(Plugins): make the tests pass
(cherry picked from commit c2754eb9cc)
Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
* Extract search users to a new service
* Fix wire provider
* Fix common_test and remove RouteRegister
* Remove old endpoints
* Fix test
* Add indexes to dashboards and orgs tables
* Fix lint
(cherry picked from commit 02702eb82d)
* keep existing unified alert rules untouched
* move silences and other alertmanager files to the organization directory (only if it is a single organization deployment)
* assign the existing notification settings and routes to the first organization
* create default notification settings for each organization in the case of multi org deployment
(cherry picked from commit 5d0d7dcb3a)
Co-authored-by: Yuriy Tseretyan <yuriy.tseretyan@grafana.com>
* Add method GetAllLatestAlertmanagerConfiguration to DBStore
* add method ApplyConfig to AlertManager
* update multiorg alert manager to load all alertmanager configs at once
(cherry picked from commit 1910d85ae0)
Co-authored-by: Yuriy Tseretyan <yuriy.tseretyan@grafana.com>
Makes sure to set the SigV4 service namespace for Elasticsearch and Prometheus.
Fixes#38440
(cherry picked from commit 45a844e77e)
Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
* influxdb: flux: handle $__interval and $__interval_ms in alert-queries
* influxdb: flux: do not handle interval-variable in the frontend
* $__interval should be rounded
* added comment
(cherry picked from commit 9f027e32b7)
Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
* influxdb: flux: use more precise start and end timestamps
* added unit test
(cherry picked from commit bf0dc3ef62)
Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
* added errors in plugin list.
* added error to details page.
* adding badge on details page.
* added some more tests.
* Renamed to disabled and will handle the scenario in the plugin catalog.
* Update public/app/features/plugins/admin/components/PluginDetailsDisabledError.tsx
Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
* fixing some nits
* added missing isDisabeld to the mock.
* adding tests to verify scenarios when plugin is disabled.
* fixed issue with formatting after file changed on GH.
Co-authored-by: Levente Balogh <balogh.levente.hu@gmail.com>
(cherry picked from commit f3002931f4)
Co-authored-by: Marcus Andersson <marcus.andersson@grafana.com>
* Update embeds with new paths, remove deprefixing
* Add dist dashboard scuemata, in CUE
Also add tests that ensure all panel plugins with models.cue are
imported by this file, so that we can't go out of sync.
* Remove comment detritus
* Check error return
* Remove hardcoded path prefix from cli validator
(cherry picked from commit 39f2ee7692)
Co-authored-by: sam boyer <sam.boyer@grafana.com>
An user within Grafana has a completely different meaning. Multi-tenancy is done via Organizations as a top-level concept.
(cherry picked from commit 35e5bfce40)
Co-authored-by: gotjosh <josue@grafana.com>
Fix bug with engine cache not updating after data source updated, introduced in #36635.
Removes the SQL engine cache because since #36635 we already have instance caching in place using the SDK instance manager.
This also adds support for disposing cached SQL/xorm engines before a query happens to a data source that has been updated. Done by letting the SQL engine implementing the InstanceDisposer interface.
Fixes#37299