From 8f5fbb4254d8bd92d5cbc9302c5bf36aa075b776 Mon Sep 17 00:00:00 2001 From: David Wittman Date: Thu, 3 Aug 2017 01:57:59 -0500 Subject: [PATCH 1/5] Fix typo in PagerDuty notifier options template (#8978) --- pkg/services/alerting/notifiers/pagerduty.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/services/alerting/notifiers/pagerduty.go b/pkg/services/alerting/notifiers/pagerduty.go index 0c98ab00e20..31c2cdeb679 100644 --- a/pkg/services/alerting/notifiers/pagerduty.go +++ b/pkg/services/alerting/notifiers/pagerduty.go @@ -21,7 +21,7 @@ func init() {

PagerDuty settings

Integration Key - +
Date: Thu, 3 Aug 2017 15:36:26 +0200 Subject: [PATCH 2/5] docs: fixes #8972. Note on clustering and alerting. --- docs/sources/alerting/rules.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/sources/alerting/rules.md b/docs/sources/alerting/rules.md index c4a3a012c46..e1db65e8148 100644 --- a/docs/sources/alerting/rules.md +++ b/docs/sources/alerting/rules.md @@ -32,9 +32,7 @@ of core Grafana. Only some data soures are supported right now. They include `Gr ### Clustering -We have not implemented clustering yet. So if you run multiple instances of grafana-server -you have to make sure [execute_alerts]({{< relref "installation/configuration.md#alerting" >}}) -is true on only one instance or otherwise you will get duplicated notifications. +Currently alerting supports a limited form of high availability. Since v4.2.0 of Grafana, alert notifications are deduped when running multiple servers. This means all alerts are executed on every server but no duplicate alert notifications are sent due to the deduping logic. Proper load balancing of alerts will be introduced in the future.
From ef0c90b9ca5d5104c615864755a44c1913f3ca26 Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Thu, 3 Aug 2017 16:58:31 +0200 Subject: [PATCH 3/5] graph: change tick decimal calculation for y-axis Fixes #8872. Use the automatic calculation by Flot to get the number of decimal places for ticks on the y-axis rather than the number of decimal places for the min value. --- public/app/plugins/panel/graph/graph.ts | 1 - public/app/plugins/panel/graph/specs/graph_specs.ts | 9 +-------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/public/app/plugins/panel/graph/graph.ts b/public/app/plugins/panel/graph/graph.ts index 21358a7e8cc..28da07b88ad 100755 --- a/public/app/plugins/panel/graph/graph.ts +++ b/public/app/plugins/panel/graph/graph.ts @@ -588,7 +588,6 @@ coreModule.directive('grafanaGraph', function($rootScope, timeSrv, popoverSrv) { if (axis.ticks[axis.ticks.length - 1] > axis.max) { axis.max = axis.ticks[axis.ticks.length - 1]; } - axis.tickDecimals = decimalPlaces(min); } else { axis.ticks = [1, 2]; delete axis.min; diff --git a/public/app/plugins/panel/graph/specs/graph_specs.ts b/public/app/plugins/panel/graph/specs/graph_specs.ts index 40cfdb2fcdd..b7f5d2865d1 100644 --- a/public/app/plugins/panel/graph/specs/graph_specs.ts +++ b/public/app/plugins/panel/graph/specs/graph_specs.ts @@ -139,8 +139,6 @@ describe('grafanaGraph', function() { expect(axisAutoscale.ticks.length).to.be(8); expect(axisAutoscale.ticks[0]).to.be(0.001); expect(axisAutoscale.ticks[7]).to.be(10000); - expect(axisAutoscale.tickDecimals).to.be(3); - var axisFixedscale = ctx.plotOptions.yaxes[1]; expect(axisFixedscale.min).to.be(0.05); @@ -148,8 +146,6 @@ describe('grafanaGraph', function() { expect(axisFixedscale.ticks.length).to.be(5); expect(axisFixedscale.ticks[0]).to.be(0.1); expect(axisFixedscale.ticks[4]).to.be(1000); - expect(axisFixedscale.tickDecimals).to.be(1); - }); }); @@ -172,7 +168,6 @@ describe('grafanaGraph', function() { expect(axisAutoscale.ticks.length).to.be(2); expect(axisAutoscale.ticks[0]).to.be(1); expect(axisAutoscale.ticks[1]).to.be(2); - expect(axisAutoscale.tickDecimals).to.be(undefined); }); }); @@ -189,7 +184,7 @@ describe('grafanaGraph', function() { data[0].yaxis = 1; }); - it('should set min to 0.1 and add a tick for 0.1 and tickDecimals to be 0', function() { + it('should set min to 0.1 and add a tick for 0.1', function() { var axisAutoscale = ctx.plotOptions.yaxes[0]; expect(axisAutoscale.transform(100)).to.be(2); expect(axisAutoscale.inverseTransform(-3)).to.be(0.001); @@ -198,7 +193,6 @@ describe('grafanaGraph', function() { expect(axisAutoscale.ticks.length).to.be(6); expect(axisAutoscale.ticks[0]).to.be(0.1); expect(axisAutoscale.ticks[5]).to.be(10000); - expect(axisAutoscale.tickDecimals).to.be(0); }); }); @@ -222,7 +216,6 @@ describe('grafanaGraph', function() { expect(axisAutoscale.ticks[0]).to.be(0.1); expect(axisAutoscale.ticks[7]).to.be(262144); expect(axisAutoscale.max).to.be(262144); - expect(axisAutoscale.tickDecimals).to.be(0); }); it('should set axis max to be max tick value', function() { From 61313478063b0e0721f204847f3c0298ea8f593f Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Thu, 3 Aug 2017 17:57:04 +0200 Subject: [PATCH 4/5] graph: adds decimals option for y-axis Fixes #8187 --- .../app/plugins/panel/graph/axes_editor.html | 20 +++++++++++-------- public/app/plugins/panel/graph/graph.ts | 2 ++ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/public/app/plugins/panel/graph/axes_editor.html b/public/app/plugins/panel/graph/axes_editor.html index b0ab759bf18..704f3b550f9 100644 --- a/public/app/plugins/panel/graph/axes_editor.html +++ b/public/app/plugins/panel/graph/axes_editor.html @@ -4,34 +4,38 @@
Left Y
Right Y
- +
- -
+ +
- -
+ +
- +
- +
+
+
+ +
- +
diff --git a/public/app/plugins/panel/graph/graph.ts b/public/app/plugins/panel/graph/graph.ts index 28da07b88ad..6b70ad36e4e 100755 --- a/public/app/plugins/panel/graph/graph.ts +++ b/public/app/plugins/panel/graph/graph.ts @@ -498,6 +498,7 @@ coreModule.directive('grafanaGraph', function($rootScope, timeSrv, popoverSrv) { logBase: panel.yaxes[0].logBase || 1, min: panel.yaxes[0].min ? _.toNumber(panel.yaxes[0].min) : null, max: panel.yaxes[0].max ? _.toNumber(panel.yaxes[0].max) : null, + tickDecimals: panel.yaxes[0].decimals !== null ? _.toNumber(panel.yaxes[0].decimals): null }; options.yaxes.push(defaults); @@ -510,6 +511,7 @@ coreModule.directive('grafanaGraph', function($rootScope, timeSrv, popoverSrv) { secondY.position = 'right'; secondY.min = panel.yaxes[1].min ? _.toNumber(panel.yaxes[1].min) : null; secondY.max = panel.yaxes[1].max ? _.toNumber(panel.yaxes[1].max) : null; + secondY.tickDecimals = panel.yaxes[1].decimals !== null ? _.toNumber(panel.yaxes[1].decimals): null; options.yaxes.push(secondY); applyLogScale(options.yaxes[1], data); From 8e618bc1697f37746f1c89b2e6a68c785b48d8d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Fievet?= <_@sebastien-fievet.fr> Date: Fri, 4 Aug 2017 11:08:41 +0200 Subject: [PATCH 5/5] Fix some typos in alerting documentation (#8986) --- docs/sources/alerting/rules.md | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/docs/sources/alerting/rules.md b/docs/sources/alerting/rules.md index e1db65e8148..ead457066e3 100644 --- a/docs/sources/alerting/rules.md +++ b/docs/sources/alerting/rules.md @@ -27,7 +27,7 @@ and the conditions that need to be met for the alert to change state and trigger ## Execution The alert rules are evaluated in the Grafana backend in a scheduler and query execution engine that is part -of core Grafana. Only some data soures are supported right now. They include `Graphite`, `Prometheus`, +of core Grafana. Only some data sources are supported right now. They include `Graphite`, `Prometheus`, `InfluxDB` and `OpenTSDB`. ### Clustering @@ -59,8 +59,8 @@ specify a query letter, time range and an aggregation function. avg() OF query(A, 5m, now) IS BELOW 14 ``` -- `avg()` Controls how the values for **each** serie should be reduced to a value that can be compared against the threshold. Click on the function to change it to another aggregation function. -- `query(A, 5m, now)` The letter defines what query to execute from the **Metrics** tab. The second two parameters defines the time range, `5m, now` means 5 minutes from now to now. You can also do `10m, now-2m` to define a time range that will be 10 minutes from now to 2 minutes from now. This is useful if you want to ignore the last 2 minutes of data. +- `avg()` Controls how the values for **each** series should be reduced to a value that can be compared against the threshold. Click on the function to change it to another aggregation function. +- `query(A, 5m, now)` The letter defines what query to execute from the **Metrics** tab. The second two parameters define the time range, `5m, now` means 5 minutes from now to now. You can also do `10m, now-2m` to define a time range that will be 10 minutes from now to 2 minutes from now. This is useful if you want to ignore the last 2 minutes of data. - `IS BELOW 14` Defines the type of threshold and the threshold value. You can click on `IS BELOW` to change the type of threshold. The query used in an alert rule cannot contain any template variables. Currently we only support `AND` and `OR` operators between conditions and they are executed serially. @@ -74,7 +74,7 @@ of another alert in your conditions, and `Time Of Day`. #### Multiple Series If a query returns multiple series then the aggregation function and threshold check will be evaluated for each series. -What Grafana does not do currently is track alert rule state **per series**. This has implications that is exemplified +What Grafana does not do currently is track alert rule state **per series**. This has implications that are detailed in the scenario below. - Alert condition with query that returns 2 series: **server1** and **server2** @@ -89,8 +89,7 @@ we plan to track state **per series** in a future release. ### No Data / Null values -Below you condition you can configure how the rule evaluation engine should handle queries that return no data or only null valued -data. +Below your conditions you can configure how the rule evaluation engine should handle queries that return no data or only null values. No Data Option | Description ------------ | ------------- @@ -100,23 +99,23 @@ Keep Last State | Keep the current alert rule state, what ever it is. ### Execution errors or timeouts -The last option is how to handle execution or timeout errors. +The last option tells how to handle execution or timeout errors. Error or timeout option | Description ------------ | ------------- Alerting | Set alert rule state to `Alerting` Keep Last State | Keep the current alert rule state, what ever it is. -If you an unreliable time series store that where queries sometime timeout or fail randomly you can set this option -t `Keep Last State` to basically ignore them. +If you have an unreliable time series store from which queries sometime timeout or fail randomly you can set this option +to `Keep Last State` in order to basically ignore them. ## Notifications In alert tab you can also specify alert rule notifications along with a detailed messsage about the alert rule. -The message can contain anything, information about how you might solve the issue, link to runbook etc. +The message can contain anything, information about how you might solve the issue, link to runbook, etc. The actual notifications are configured and shared between multiple alerts. Read the -[Notifications]({{< relref "notifications.md" >}}) guide for how to configure and setup notifications. +[notifications]({{< relref "notifications.md" >}}) guide for how to configure and setup notifications. ## Alert State History & Annotations @@ -129,7 +128,7 @@ submenu in the alert tab to view & clear state history. {{< imgbox max-width="40%" img="/img/docs/v4/alert_test_rule.png" caption="Test Rule" >}} First level of troubleshooting you can do is hit the **Test Rule** button. You will get result back that you can expand -to the point where you can see the raw data that was returned form your query. +to the point where you can see the raw data that was returned from your query. Further troubleshooting can also be done by inspecting the grafana-server log. If it's not an error or for some reason the log does not say anything you can enable debug logging for some relevant components. This is done