Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
3c0b1ef5
Unverified
Commit
3c0b1ef5
authored
Sep 06, 2018
by
Carl Bergquist
Committed by
GitHub
Sep 06, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #13170 from bergquist/alerting_default_setting
make default values for alerting configurable
parents
e3641197
1e33a378
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
48 additions
and
18 deletions
+48
-18
conf/defaults.ini
+6
-0
conf/sample.ini
+6
-0
docs/sources/installation/configuration.md
+10
-0
pkg/api/frontendsettings.go
+16
-14
pkg/setting/setting.go
+6
-2
public/app/core/config.ts
+2
-0
public/app/features/alerting/alert_tab_ctrl.ts
+2
-2
No files found.
conf/defaults.ini
View file @
3c0b1ef5
...
...
@@ -467,6 +467,12 @@ enabled = true
# Makes it possible to turn off alert rule execution but alerting UI is visible
execute_alerts
=
true
# Default setting for new alert rules. Defaults to categorize 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]
# Enable the Explore section
...
...
conf/sample.ini
View file @
3c0b1ef5
...
...
@@ -387,6 +387,12 @@ log_queries =
# Makes it possible to turn off alert rule execution but alerting UI is visible
;execute_alerts = true
# Default setting for new alert rules. Defaults to categorize 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]
# Enable the Explore section
...
...
docs/sources/installation/configuration.md
View file @
3c0b1ef5
...
...
@@ -556,3 +556,13 @@ Defaults to true. Set to false to disable alerting engine and hide Alerting from
### execute_alerts
Makes it possible to turn off alert rule execution.
### error_or_timeout
> Available in 5.3 and above
Default setting for new alert rules. Defaults to categorize error and timeouts as alerting. (alerting, keep_state)
### nodata_or_nullvalues
> Available in 5.3 and above
Default setting for how Grafana handles nodata or null values in alerting. (alerting, no_data, keep_state, ok)
pkg/api/frontendsettings.go
View file @
3c0b1ef5
...
...
@@ -132,20 +132,22 @@ func getFrontendSettingsMap(c *m.ReqContext) (map[string]interface{}, error) {
}
jsonObj
:=
map
[
string
]
interface
{}{
"defaultDatasource"
:
defaultDatasource
,
"datasources"
:
datasources
,
"panels"
:
panels
,
"appSubUrl"
:
setting
.
AppSubUrl
,
"allowOrgCreate"
:
(
setting
.
AllowUserOrgCreate
&&
c
.
IsSignedIn
)
||
c
.
IsGrafanaAdmin
,
"authProxyEnabled"
:
setting
.
AuthProxyEnabled
,
"ldapEnabled"
:
setting
.
LdapEnabled
,
"alertingEnabled"
:
setting
.
AlertingEnabled
,
"exploreEnabled"
:
setting
.
ExploreEnabled
,
"googleAnalyticsId"
:
setting
.
GoogleAnalyticsId
,
"disableLoginForm"
:
setting
.
DisableLoginForm
,
"externalUserMngInfo"
:
setting
.
ExternalUserMngInfo
,
"externalUserMngLinkUrl"
:
setting
.
ExternalUserMngLinkUrl
,
"externalUserMngLinkName"
:
setting
.
ExternalUserMngLinkName
,
"defaultDatasource"
:
defaultDatasource
,
"datasources"
:
datasources
,
"panels"
:
panels
,
"appSubUrl"
:
setting
.
AppSubUrl
,
"allowOrgCreate"
:
(
setting
.
AllowUserOrgCreate
&&
c
.
IsSignedIn
)
||
c
.
IsGrafanaAdmin
,
"authProxyEnabled"
:
setting
.
AuthProxyEnabled
,
"ldapEnabled"
:
setting
.
LdapEnabled
,
"alertingEnabled"
:
setting
.
AlertingEnabled
,
"alertingErrorOrTimeout"
:
setting
.
AlertingErrorOrTimeout
,
"alertingNoDataOrNullValues"
:
setting
.
AlertingNoDataOrNullValues
,
"exploreEnabled"
:
setting
.
ExploreEnabled
,
"googleAnalyticsId"
:
setting
.
GoogleAnalyticsId
,
"disableLoginForm"
:
setting
.
DisableLoginForm
,
"externalUserMngInfo"
:
setting
.
ExternalUserMngInfo
,
"externalUserMngLinkUrl"
:
setting
.
ExternalUserMngLinkUrl
,
"externalUserMngLinkName"
:
setting
.
ExternalUserMngLinkName
,
"buildInfo"
:
map
[
string
]
interface
{}{
"version"
:
setting
.
BuildVersion
,
"commit"
:
setting
.
BuildCommit
,
...
...
pkg/setting/setting.go
View file @
3c0b1ef5
...
...
@@ -164,8 +164,10 @@ var (
Quota
QuotaSettings
// Alerting
AlertingEnabled
bool
ExecuteAlerts
bool
AlertingEnabled
bool
ExecuteAlerts
bool
AlertingErrorOrTimeout
string
AlertingNoDataOrNullValues
string
// Explore UI
ExploreEnabled
bool
...
...
@@ -672,6 +674,8 @@ func (cfg *Cfg) Load(args *CommandLineArgs) error {
alerting
:=
iniFile
.
Section
(
"alerting"
)
AlertingEnabled
=
alerting
.
Key
(
"enabled"
)
.
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"
)
ExploreEnabled
=
explore
.
Key
(
"enabled"
)
.
MustBool
(
false
)
...
...
public/app/core/config.ts
View file @
3c0b1ef5
...
...
@@ -22,6 +22,8 @@ export class Settings {
disableLoginForm
:
boolean
;
defaultDatasource
:
string
;
alertingEnabled
:
boolean
;
alertingErrorOrTimeout
:
string
;
alertingNoDataOrNullValues
:
string
;
authProxyEnabled
:
boolean
;
exploreEnabled
:
boolean
;
ldapEnabled
:
boolean
;
...
...
public/app/features/alerting/alert_tab_ctrl.ts
View file @
3c0b1ef5
...
...
@@ -164,8 +164,8 @@ export class AlertTabCtrl {
alert
.
conditions
.
push
(
this
.
buildDefaultCondition
());
}
alert
.
noDataState
=
alert
.
noDataState
||
'no_data'
;
alert
.
executionErrorState
=
alert
.
executionErrorState
||
'alerting'
;
alert
.
noDataState
=
alert
.
noDataState
||
config
.
alertingNoDataOrNullValues
;
alert
.
executionErrorState
=
alert
.
executionErrorState
||
config
.
alertingErrorOrTimeout
;
alert
.
frequency
=
alert
.
frequency
||
'60s'
;
alert
.
handler
=
alert
.
handler
||
1
;
alert
.
notifications
=
alert
.
notifications
||
[];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment