mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
make default values for alerting configurable
This commit is contained in:
parent
72ab24f300
commit
3ce89cad71
@ -467,6 +467,12 @@ enabled = true
|
|||||||
# Makes it possible to turn off alert rule execution but alerting UI is visible
|
# Makes it possible to turn off alert rule execution but alerting UI is visible
|
||||||
execute_alerts = true
|
execute_alerts = true
|
||||||
|
|
||||||
|
# Default setting for new alert rules. Defaults to categories error and timeouts as alerting. (alerting, keep_state)
|
||||||
|
error_or_timeout = alerting
|
||||||
|
|
||||||
|
# Default setting for how Grafana handles nodata or null values in alerting. (alerting, no_data, keep_state, ok)
|
||||||
|
nodata_or_nullvalues = no_data
|
||||||
|
|
||||||
#################################### Explore #############################
|
#################################### Explore #############################
|
||||||
[explore]
|
[explore]
|
||||||
# Enable the Explore section
|
# Enable the Explore section
|
||||||
|
@ -387,6 +387,12 @@ log_queries =
|
|||||||
# Makes it possible to turn off alert rule execution but alerting UI is visible
|
# Makes it possible to turn off alert rule execution but alerting UI is visible
|
||||||
;execute_alerts = true
|
;execute_alerts = true
|
||||||
|
|
||||||
|
# Default setting for new alert rules. Defaults to categories error and timeouts as alerting. (alerting, keep_state)
|
||||||
|
;error_or_timeout = alerting
|
||||||
|
|
||||||
|
# Default setting for how Grafana handles nodata or null values in alerting. (alerting, no_data, keep_state, ok)
|
||||||
|
;nodata_or_nullvalues = no_data
|
||||||
|
|
||||||
#################################### Explore #############################
|
#################################### Explore #############################
|
||||||
[explore]
|
[explore]
|
||||||
# Enable the Explore section
|
# Enable the Explore section
|
||||||
|
@ -1009,3 +1009,11 @@ Defaults to true. Set to false to disable alerting engine and hide Alerting from
|
|||||||
### execute_alerts
|
### execute_alerts
|
||||||
|
|
||||||
Makes it possible to turn off alert rule execution.
|
Makes it possible to turn off alert rule execution.
|
||||||
|
|
||||||
|
### error_or_timeout
|
||||||
|
|
||||||
|
Default setting for new alert rules. Defaults to categories error and timeouts as alerting. (alerting, keep_state)
|
||||||
|
|
||||||
|
### nodata_or_nullvalues
|
||||||
|
|
||||||
|
Default setting for how Grafana handles nodata or null values in alerting. (alerting, no_data, keep_state, ok)
|
||||||
|
@ -132,20 +132,22 @@ func getFrontendSettingsMap(c *m.ReqContext) (map[string]interface{}, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
jsonObj := map[string]interface{}{
|
jsonObj := map[string]interface{}{
|
||||||
"defaultDatasource": defaultDatasource,
|
"defaultDatasource": defaultDatasource,
|
||||||
"datasources": datasources,
|
"datasources": datasources,
|
||||||
"panels": panels,
|
"panels": panels,
|
||||||
"appSubUrl": setting.AppSubUrl,
|
"appSubUrl": setting.AppSubUrl,
|
||||||
"allowOrgCreate": (setting.AllowUserOrgCreate && c.IsSignedIn) || c.IsGrafanaAdmin,
|
"allowOrgCreate": (setting.AllowUserOrgCreate && c.IsSignedIn) || c.IsGrafanaAdmin,
|
||||||
"authProxyEnabled": setting.AuthProxyEnabled,
|
"authProxyEnabled": setting.AuthProxyEnabled,
|
||||||
"ldapEnabled": setting.LdapEnabled,
|
"ldapEnabled": setting.LdapEnabled,
|
||||||
"alertingEnabled": setting.AlertingEnabled,
|
"alertingEnabled": setting.AlertingEnabled,
|
||||||
"exploreEnabled": setting.ExploreEnabled,
|
"alertingErrorOrTimeout": setting.AlertingErrorOrTimeout,
|
||||||
"googleAnalyticsId": setting.GoogleAnalyticsId,
|
"alertingNoDataOrNullValues": setting.AlertingNoDataOrNullValues,
|
||||||
"disableLoginForm": setting.DisableLoginForm,
|
"exploreEnabled": setting.ExploreEnabled,
|
||||||
"externalUserMngInfo": setting.ExternalUserMngInfo,
|
"googleAnalyticsId": setting.GoogleAnalyticsId,
|
||||||
"externalUserMngLinkUrl": setting.ExternalUserMngLinkUrl,
|
"disableLoginForm": setting.DisableLoginForm,
|
||||||
"externalUserMngLinkName": setting.ExternalUserMngLinkName,
|
"externalUserMngInfo": setting.ExternalUserMngInfo,
|
||||||
|
"externalUserMngLinkUrl": setting.ExternalUserMngLinkUrl,
|
||||||
|
"externalUserMngLinkName": setting.ExternalUserMngLinkName,
|
||||||
"buildInfo": map[string]interface{}{
|
"buildInfo": map[string]interface{}{
|
||||||
"version": setting.BuildVersion,
|
"version": setting.BuildVersion,
|
||||||
"commit": setting.BuildCommit,
|
"commit": setting.BuildCommit,
|
||||||
|
@ -164,8 +164,10 @@ var (
|
|||||||
Quota QuotaSettings
|
Quota QuotaSettings
|
||||||
|
|
||||||
// Alerting
|
// Alerting
|
||||||
AlertingEnabled bool
|
AlertingEnabled bool
|
||||||
ExecuteAlerts bool
|
ExecuteAlerts bool
|
||||||
|
AlertingErrorOrTimeout string
|
||||||
|
AlertingNoDataOrNullValues string
|
||||||
|
|
||||||
// Explore UI
|
// Explore UI
|
||||||
ExploreEnabled bool
|
ExploreEnabled bool
|
||||||
@ -672,6 +674,8 @@ func (cfg *Cfg) Load(args *CommandLineArgs) error {
|
|||||||
alerting := iniFile.Section("alerting")
|
alerting := iniFile.Section("alerting")
|
||||||
AlertingEnabled = alerting.Key("enabled").MustBool(true)
|
AlertingEnabled = alerting.Key("enabled").MustBool(true)
|
||||||
ExecuteAlerts = alerting.Key("execute_alerts").MustBool(true)
|
ExecuteAlerts = alerting.Key("execute_alerts").MustBool(true)
|
||||||
|
AlertingErrorOrTimeout = alerting.Key("error_or_timeout").MustString("alerting")
|
||||||
|
AlertingNoDataOrNullValues = alerting.Key("nodata_or_nullvalues").MustString("no_data")
|
||||||
|
|
||||||
explore := iniFile.Section("explore")
|
explore := iniFile.Section("explore")
|
||||||
ExploreEnabled = explore.Key("enabled").MustBool(false)
|
ExploreEnabled = explore.Key("enabled").MustBool(false)
|
||||||
|
@ -22,6 +22,8 @@ export class Settings {
|
|||||||
disableLoginForm: boolean;
|
disableLoginForm: boolean;
|
||||||
defaultDatasource: string;
|
defaultDatasource: string;
|
||||||
alertingEnabled: boolean;
|
alertingEnabled: boolean;
|
||||||
|
alertingErrorOrTimeout: string;
|
||||||
|
alertingNoDataOrNullValues: string;
|
||||||
authProxyEnabled: boolean;
|
authProxyEnabled: boolean;
|
||||||
exploreEnabled: boolean;
|
exploreEnabled: boolean;
|
||||||
ldapEnabled: boolean;
|
ldapEnabled: boolean;
|
||||||
|
@ -164,8 +164,8 @@ export class AlertTabCtrl {
|
|||||||
alert.conditions.push(this.buildDefaultCondition());
|
alert.conditions.push(this.buildDefaultCondition());
|
||||||
}
|
}
|
||||||
|
|
||||||
alert.noDataState = alert.noDataState || 'no_data';
|
alert.noDataState = alert.noDataState || config.alertingNoDataOrNullValues;
|
||||||
alert.executionErrorState = alert.executionErrorState || 'alerting';
|
alert.executionErrorState = alert.executionErrorState || config.alertingErrorOrTimeout;
|
||||||
alert.frequency = alert.frequency || '60s';
|
alert.frequency = alert.frequency || '60s';
|
||||||
alert.handler = alert.handler || 1;
|
alert.handler = alert.handler || 1;
|
||||||
alert.notifications = alert.notifications || [];
|
alert.notifications = alert.notifications || [];
|
||||||
|
Loading…
Reference in New Issue
Block a user