Skip to content

Commit 585a0bd

Browse files
4565: updating docs
1 parent 93e9d67 commit 585a0bd

File tree

9 files changed

+119
-94
lines changed

9 files changed

+119
-94
lines changed
Lines changed: 78 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,119 @@
11
---
22
# generated by https://github.com/hashicorp/terraform-plugin-docs
3-
page_title: "grafana_asserts_alert_config Resource - terraform-provider-grafana"
3+
page_title: "grafana_asserts_notification_alerts_config Resource - terraform-provider-grafana"
44
subcategory: "Asserts"
55
description: |-
66
Manages Asserts Alert Configurations through Grafana API.
77
---
88

9-
# grafana_asserts_alert_config (Resource)
9+
# grafana_asserts_notification_alerts_config (Resource)
1010

1111
Manages Asserts Alert Configurations through Grafana API.
1212

13+
## Example Usage
1314

14-
<<<<<<<< HEAD:docs/resources/asserts_alert_config.md
1515
```terraform
16-
resource "grafana_asserts_alert_config" "high_error_rate" {
17-
stack_id = data.grafana_cloud_stack.test.id
18-
name = "HighErrorRate"
16+
# Basic alert configuration with silencing
17+
resource "grafana_asserts_notification_alerts_config" "prometheus_remote_storage_failures" {
18+
name = "PrometheusRemoteStorageFailures"
1919
2020
match_labels = {
21-
service = "api-service"
22-
env = "production"
21+
alertname = "PrometheusRemoteStorageFailures"
22+
alertgroup = "prometheus.alerts"
23+
asserts_env = "prod"
24+
}
25+
26+
silenced = true
27+
}
28+
29+
# High severity alert with specific job and context matching
30+
resource "grafana_asserts_notification_alerts_config" "error_buildup_notify" {
31+
name = "ErrorBuildupNotify"
32+
33+
match_labels = {
34+
alertname = "ErrorBuildup"
35+
job = "acai"
36+
asserts_request_type = "inbound"
37+
asserts_request_context = "/auth"
38+
}
39+
40+
silenced = false
41+
}
42+
43+
# Alert with additional labels and custom duration
44+
resource "grafana_asserts_notification_alerts_config" "payment_test_alert" {
45+
name = "PaymentTestAlert"
46+
47+
match_labels = {
48+
alertname = "PaymentTestAlert"
49+
additional_labels = "asserts_severity=~\"critical\""
50+
alertgroup = "alex-k8s-integration-test.alerts"
2351
}
2452
2553
alert_labels = {
26-
severity = "critical"
27-
team = "platform"
54+
testing = "onetwothree"
2855
}
2956
3057
duration = "5m"
3158
silenced = false
3259
}
3360
34-
resource "grafana_asserts_alert_config" "slow_response_time" {
35-
stack_id = data.grafana_cloud_stack.test.id
36-
name = "SlowResponseTime"
61+
# Latency alert for shipping service
62+
resource "grafana_asserts_notification_alerts_config" "high_shipping_latency" {
63+
name = "high shipping latency"
3764
3865
match_labels = {
39-
service = "web-frontend"
40-
env = "production"
66+
alertname = "LatencyP99ErrorBuildup"
67+
job = "shipping"
68+
asserts_request_type = "inbound"
4169
}
4270
43-
alert_labels = {
44-
severity = "warning"
45-
team = "frontend"
71+
silenced = false
72+
}
73+
74+
# CPU throttling alert with warning severity
75+
resource "grafana_asserts_notification_alerts_config" "cpu_throttling_sustained" {
76+
name = "CPUThrottlingSustained"
77+
78+
match_labels = {
79+
alertname = "CPUThrottlingSustained"
80+
additional_labels = "asserts_severity=~\"warning\""
81+
}
82+
83+
silenced = true
84+
}
85+
86+
# Ingress error rate alert
87+
resource "grafana_asserts_notification_alerts_config" "ingress_error" {
88+
name = "ingress error"
89+
90+
match_labels = {
91+
alertname = "ErrorRatioBreach"
92+
job = "ingress-nginx-controller-metrics"
93+
asserts_request_type = "inbound"
94+
}
95+
96+
silenced = false
97+
}
98+
99+
# MySQL Galera cluster alert
100+
resource "grafana_asserts_notification_alerts_config" "mysql_galera_not_ready" {
101+
name = "MySQLGaleraNotReady"
102+
103+
match_labels = {
104+
alertname = "MySQLGaleraNotReady"
46105
}
47106
48-
duration = "10m"
49107
silenced = false
50108
}
51109
```
52-
========
53-
>>>>>>>> 2e353e91 (4565: updating docs):docs/resources/asserts_notification_alerts_config.md
54110

55111
<!-- schema generated by tfplugindocs -->
56112
## Schema
57113

58114
### Required
59115

60116
- `name` (String) The name of the alert configuration.
61-
- `stack_id` (Number) The Stack ID of the Grafana Cloud instance.
62117

63118
### Optional
64119

@@ -76,5 +131,5 @@ resource "grafana_asserts_alert_config" "slow_response_time" {
76131
Import is supported using the following syntax:
77132

78133
```shell
79-
terraform import grafana_asserts_alert_config.name "{{ name }}"
134+
terraform import grafana_asserts_notification_alerts_config.name "{{ name }}"
80135
```
Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,56 @@
11
---
22
# generated by https://github.com/hashicorp/terraform-plugin-docs
3-
page_title: "grafana_asserts_disabled_alert_config Resource - terraform-provider-grafana"
3+
page_title: "grafana_asserts_suppressed_assertions_config Resource - terraform-provider-grafana"
44
subcategory: "Asserts"
55
description: |-
66
Manages Asserts Disabled Alert Configurations through Grafana API.
77
---
88

9-
# grafana_asserts_disabled_alert_config (Resource)
9+
# grafana_asserts_suppressed_assertions_config (Resource)
1010

1111
Manages Asserts Disabled Alert Configurations through Grafana API.
1212

13+
## Example Usage
1314

14-
<<<<<<<< HEAD:docs/resources/asserts_disabled_alert_config.md
1515
```terraform
16-
resource "grafana_asserts_disabled_alert_config" "maintenance_window" {
17-
stack_id = data.grafana_cloud_stack.test.id
18-
name = "MaintenanceWindow"
16+
# Basic suppressed alert configuration for maintenance
17+
resource "grafana_asserts_suppressed_assertions_config" "maintenance_window" {
18+
name = "MaintenanceWindow"
1919
2020
match_labels = {
2121
service = "api-service"
2222
maintenance = "true"
2323
}
2424
}
25+
26+
# Suppress specific alertname during deployment
27+
resource "grafana_asserts_suppressed_assertions_config" "deployment_suppression" {
28+
name = "DeploymentSuppression"
29+
30+
match_labels = {
31+
alertname = "HighLatency"
32+
job = "web-service"
33+
env = "staging"
34+
}
35+
}
36+
37+
# Suppress alerts for specific test environment
38+
resource "grafana_asserts_suppressed_assertions_config" "test_environment_suppression" {
39+
name = "TestEnvironmentSuppression"
40+
41+
match_labels = {
42+
alertgroup = "test.alerts"
43+
environment = "test"
44+
}
45+
}
2546
```
26-
========
27-
>>>>>>>> 2e353e91 (4565: updating docs):docs/resources/asserts_suppressed_assertions_config.md
2847

2948
<!-- schema generated by tfplugindocs -->
3049
## Schema
3150

3251
### Required
3352

3453
- `name` (String) The name of the disabled alert configuration.
35-
- `stack_id` (Number) The Stack ID of the Grafana Cloud instance.
3654

3755
### Optional
3856

@@ -47,5 +65,5 @@ resource "grafana_asserts_disabled_alert_config" "maintenance_window" {
4765
Import is supported using the following syntax:
4866

4967
```shell
50-
terraform import grafana_asserts_disabled_alert_config.name "{{ name }}"
68+
terraform import grafana_asserts_suppressed_assertions_config.name "{{ name }}"
5169
```

examples/resources/grafana_asserts_alert_config/import.sh

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/resources/grafana_asserts_alert_config/resource.tf

Lines changed: 0 additions & 35 deletions
This file was deleted.

examples/resources/grafana_asserts_disabled_alert_config/import.sh

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/resources/grafana_asserts_disabled_alert_config/resource.tf

Lines changed: 0 additions & 9 deletions
This file was deleted.

examples/resources/grafana_asserts_notification_alerts_config/resource.tf

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ resource "grafana_asserts_notification_alerts_config" "prometheus_remote_storage
33
name = "PrometheusRemoteStorageFailures"
44

55
match_labels = {
6-
alertname = "PrometheusRemoteStorageFailures"
7-
alertgroup = "prometheus.alerts"
8-
asserts_env = "prod"
6+
alertname = "PrometheusRemoteStorageFailures"
7+
alertgroup = "prometheus.alerts"
8+
asserts_env = "prod"
99
}
1010

1111
silenced = true
@@ -16,10 +16,10 @@ resource "grafana_asserts_notification_alerts_config" "error_buildup_notify" {
1616
name = "ErrorBuildupNotify"
1717

1818
match_labels = {
19-
alertname = "ErrorBuildup"
20-
job = "acai"
21-
asserts_request_type = "inbound"
22-
asserts_request_context = "/auth"
19+
alertname = "ErrorBuildup"
20+
job = "acai"
21+
asserts_request_type = "inbound"
22+
asserts_request_context = "/auth"
2323
}
2424

2525
silenced = false
@@ -30,9 +30,9 @@ resource "grafana_asserts_notification_alerts_config" "payment_test_alert" {
3030
name = "PaymentTestAlert"
3131

3232
match_labels = {
33-
alertname = "PaymentTestAlert"
34-
additional_labels = "asserts_severity=~\"critical\""
35-
alertgroup = "alex-k8s-integration-test.alerts"
33+
alertname = "PaymentTestAlert"
34+
additional_labels = "asserts_severity=~\"critical\""
35+
alertgroup = "alex-k8s-integration-test.alerts"
3636
}
3737

3838
alert_labels = {
@@ -61,8 +61,8 @@ resource "grafana_asserts_notification_alerts_config" "cpu_throttling_sustained"
6161
name = "CPUThrottlingSustained"
6262

6363
match_labels = {
64-
alertname = "CPUThrottlingSustained"
65-
additional_labels = "asserts_severity=~\"warning\""
64+
alertname = "CPUThrottlingSustained"
65+
additional_labels = "asserts_severity=~\"warning\""
6666
}
6767

6868
silenced = true

examples/resources/grafana_asserts_suppressed_assertions_config/resource.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ resource "grafana_asserts_suppressed_assertions_config" "test_environment_suppre
2424
name = "TestEnvironmentSuppression"
2525

2626
match_labels = {
27-
alertgroup = "test.alerts"
27+
alertgroup = "test.alerts"
2828
environment = "test"
2929
}
3030
}

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,6 @@ github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e h1:JKmoR8x90Iww1
170170
github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
171171
github.com/gorilla/mux v1.8.1 h1:TuBL49tXwgrFYWhqrNgrUNEY92u81SPhu7sTdzQEiWY=
172172
github.com/gorilla/mux v1.8.1/go.mod h1:AKf9I4AEqPTmMytcMc0KkNouC66V3BtZ4qD5fmWSiMQ=
173-
github.com/grafana/amixr-api-go-client v0.0.24 h1:Yvj8Ir02e3GTcetd+qHmajrLC690YJxK8lppEUkrsyA=
174-
github.com/grafana/amixr-api-go-client v0.0.24/go.mod h1:ihgLhTVimmjASuZ06y/mQxPcYH3toAIuUVGK6flHsMU=
175173
github.com/grafana/amixr-api-go-client v0.0.25 h1:tAQeJRuq9ihHotxq6/oEB6lIhuAdM+MUP0uPkNn1I3A=
176174
github.com/grafana/amixr-api-go-client v0.0.25/go.mod h1:ihgLhTVimmjASuZ06y/mQxPcYH3toAIuUVGK6flHsMU=
177175
github.com/grafana/authlib/claims v0.0.0-20250120084028-e3328c576437 h1:OlwbIVFcYgMjnQhpbZwRPVNrvZKTodvPMqwb8yEqVW0=

0 commit comments

Comments
 (0)