-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from dasmeta/DMVP-2489-alert-expressions
feat(DMVP-2489): Changed alert rules expression structure.
- Loading branch information
Showing
15 changed files
with
195 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
terraform { | ||
required_providers { | ||
test = { | ||
source = "terraform.io/builtin/test" | ||
} | ||
grafana = { | ||
source = "grafana/grafana" | ||
} | ||
} | ||
} | ||
|
||
provider "grafana" { | ||
url = "https://grafana.example.com/" | ||
auth = "xxxxxxxxxxx" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
module "this" { | ||
source = "../../" | ||
|
||
alert_rules = [ | ||
{ | ||
name = "Maximum node utilization in cluster" | ||
summary = "Cluster is using 8 available nodes" | ||
folder_name = "Node Autoscaling" | ||
datasource = "prometheus" | ||
filters = null | ||
metric_name = "sum(kube_node_info)" | ||
function = "mean" | ||
equation = "gt" | ||
threshold = "8" | ||
}, | ||
{ | ||
name = "High node utilization in cluster" | ||
summary = "Cluster is using 6 of the available 8 nodes" | ||
folder_name = "Node Autoscaling" | ||
datasource = "prometheus" | ||
filters = null | ||
metric_name = "sum(kube_node_info)" | ||
function = "mean" | ||
equation = "gt" | ||
threshold = "6" | ||
}, | ||
{ | ||
name = "Insufficient nodes in cluster" | ||
summary = "Cluster is using fewer nodes than the required count" | ||
folder_name = "Node Autoscaling" | ||
datasource = "prometheus" | ||
filters = null | ||
metric_name = "sum(kube_node_info)" | ||
function = "mean" | ||
equation = "lt" | ||
threshold = "2" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
resource "test_assertions" "dummy" { | ||
component = "grafana-modules-alerts" | ||
|
||
equal "scheme" { | ||
description = "As module does not have any output and data just make sure the case runs. Probably can be thrown away." | ||
got = "all good" | ||
want = "all good" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Node Autoscaling | ||
This test case demonstrates how to configure Grafana alerts for monitoring Node count in the cluster. | ||
|
||
Basically it notifies you when node autoscaling reaches | ||
- to its maximum, in our case: `$B >= 8`, | ||
- to more count than the half of maximum: `$B >= 6`, | ||
- to its minimum, in our case: `$B <= 2`. | ||
|
||
Replace the values in the conditions with your real numbers. | ||
|
||
## Usage | ||
Please, note that we pass `null` value to `filters` variable. It's needed when we use such Prometheus metrics which don't get any filters when querying. | ||
|
||
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --> | ||
## Requirements | ||
|
||
No requirements. | ||
|
||
## Providers | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| <a name="provider_test"></a> [test](#provider\_test) | n/a | | ||
|
||
## Modules | ||
|
||
| Name | Source | Version | | ||
|------|--------|---------| | ||
| <a name="module_this"></a> [this](#module\_this) | ../../ | n/a | | ||
|
||
## Resources | ||
|
||
| Name | Type | | ||
|------|------| | ||
| test_assertions.dummy | resource | | ||
|
||
## Inputs | ||
|
||
No inputs. | ||
|
||
## Outputs | ||
|
||
No outputs. | ||
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters