* add handling for legacy and k8s apis to frontend
* use backend srv directly not redux
* add unit test to make sure the correct apis are being called
* require api server flag
* fix feature toggle name
* ensure both pages work correctly
* make consistent with legacy api
* implement webhook update
* fix unit test
* remove old apis and update
---------
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
* declare new API and models GettableTimeIntervals, PostableTimeIntervals
* add new actions alert.notifications.time-intervals:read and alert.notifications.time-intervals:write.
* update existing alerting roles with the read action. Add to all alerting roles.
* add integration tests
* Create locking config store that mimics existing provisioning store
* Rename existing receivers(_test).go
* Introduce shared receiver group service
* Fix test
* Move query model to models package
* ReceiverGroup -> Receiver
* Remove locking config store
* Move convert methods to compat.go
* Cleanup
This commit prevents saving configurations containing inhibition
rules in Grafana Alertmanager. It does not reject inhibition
rules when using external Alertmanagers, such as Mimir. This meant
the validation had to be put in the MultiOrgAlertmanager instead of
in the validation of PostableUserConfig. We can remove this when
inhibition rules are supported in Grafana Managed Alerts.
* Add secureSocksDSProxyEnabled label to grafana_datasource_request_duration_seconds
* rename label from secureSocksDSProxyEnabled to secure_socks_ds_proxy_enabled
* DataSourceMetricsMiddleware: add secure_socks_ds_proxy_enabled label to every metric
* create the feature flag
* bring the concurrency in to the play
* Update feature flag
* Use concurrency number from settings
* update influxdb dependency
* use ConcurrentQueryCount from plugin-sdk-go
* use helper method for concurrent query count
* log the error
* add value guard
* add unit tests
* handle concurrency error
* use regex as templateSrv replace format
* use regex as templateSrv replace format for raw queries
* import path fix
* don't use regex formatter
* tag value escape
* tag value escape with wrappers
* polished interpolation logic
* update unit tests
* comments and more place to update
* unit test update
* fix escaping
* handle the string and array of string type separately
* update variable type
AM config applied via API would use the PostableUserConfig as the AM raw
config and also the hash used to decide when the AM config has changed.
However, when applied via the periodic sync the PostableApiAlertingConfig would
be used instead.
This leads to two issues:
- Inconsistent hash comparisons when modifying the AM causing redundant applies.
- GetStatus assumed the raw config was PostableUserConfig causing the endpoint
to return correctly after a new config is applied via API and then nothing once
the periodic sync runs.
Note: Technically, the upstream GrafanaAlertamanger GetStatus shouldn't be
returning PostableUserConfig or PostableApiAlertingConfig, but instead
GettableStatus. However, this issue required changes elsewhere and is out of
scope.
* add feature toggle
* add a middleware that appens headers for IP range AC
* sort imports
* sign IP range header and only append it if the request is going to allow listed data sources
* sign a random generated string instead of IP, also change the name of the middleware to make it more generic
* remove the DS IP range AC options from the config file; remove unwanted change
* add test
* sanitize the URLs when comparing
* cleanup and fixes
* check if X-Real-Ip is present, and set the internal request header if it is not present
* use split string function from the util package