feat: implement observability log alertgroups (#785)
This commit is contained in:
parent
616788087c
commit
3c20b7743f
15 changed files with 1860 additions and 13 deletions
|
|
@ -3,12 +3,12 @@
|
|||
page_title: "stackit_observability_alertgroup Resource - stackit"
|
||||
subcategory: ""
|
||||
description: |-
|
||||
Observability alert group resource schema. Must have a region specified in the provider configuration.
|
||||
Observability alert group resource schema. Used to create alerts based on metrics (Thanos). Must have a region specified in the provider configuration.
|
||||
---
|
||||
|
||||
# stackit_observability_alertgroup (Resource)
|
||||
|
||||
Observability alert group resource schema. Must have a `region` specified in the provider configuration.
|
||||
Observability alert group resource schema. Used to create alerts based on metrics (Thanos). Must have a `region` specified in the provider configuration.
|
||||
|
||||
## Example Usage
|
||||
|
||||
|
|
|
|||
80
docs/resources/observability_logalertgroup.md
Normal file
80
docs/resources/observability_logalertgroup.md
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
---
|
||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
||||
page_title: "stackit_observability_logalertgroup Resource - stackit"
|
||||
subcategory: ""
|
||||
description: |-
|
||||
Observability log alert group resource schema. Used to create alerts based on logs (Loki). Must have a region specified in the provider configuration.
|
||||
---
|
||||
|
||||
# stackit_observability_logalertgroup (Resource)
|
||||
|
||||
Observability log alert group resource schema. Used to create alerts based on logs (Loki). Must have a `region` specified in the provider configuration.
|
||||
|
||||
## Example Usage
|
||||
|
||||
```terraform
|
||||
resource "stackit_observability_logalertgroup" "example" {
|
||||
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
instance_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
|
||||
name = "example-log-alert-group"
|
||||
interval = "60m"
|
||||
rules = [
|
||||
{
|
||||
alert = "example-log-alert-name"
|
||||
expression = "sum(rate({namespace=\"example\", pod=\"logger\"} |= \"Simulated error message\" [1m])) > 0"
|
||||
for = "60s"
|
||||
labels = {
|
||||
severity = "critical"
|
||||
},
|
||||
annotations = {
|
||||
summary : "example summary"
|
||||
description : "example description"
|
||||
}
|
||||
},
|
||||
{
|
||||
alert = "example-log-alert-name-2"
|
||||
expression = "sum(rate({namespace=\"example\", pod=\"logger\"} |= \"Another error message\" [1m])) > 0"
|
||||
for = "60s"
|
||||
labels = {
|
||||
severity = "critical"
|
||||
},
|
||||
annotations = {
|
||||
summary : "example summary"
|
||||
description : "example description"
|
||||
}
|
||||
},
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
<!-- schema generated by tfplugindocs -->
|
||||
## Schema
|
||||
|
||||
### Required
|
||||
|
||||
- `instance_id` (String) Observability instance ID to which the log alert group is associated.
|
||||
- `name` (String) The name of the log alert group. Is the identifier and must be unique in the group.
|
||||
- `project_id` (String) STACKIT project ID to which the log alert group is associated.
|
||||
- `rules` (Attributes List) Rules for the log alert group (see [below for nested schema](#nestedatt--rules))
|
||||
|
||||
### Optional
|
||||
|
||||
- `interval` (String) Specifies the frequency at which rules within the group are evaluated. The interval must be at least 60 seconds and defaults to 60 seconds if not set. Supported formats include hours, minutes, and seconds, either singly or in combination. Examples of valid formats are: '5h30m40s', '5h', '5h30m', '60m', and '60s'.
|
||||
|
||||
### Read-Only
|
||||
|
||||
- `id` (String) Terraform's internal resource ID. It is structured as "`project_id`,`instance_id`,`name`".
|
||||
|
||||
<a id="nestedatt--rules"></a>
|
||||
### Nested Schema for `rules`
|
||||
|
||||
Required:
|
||||
|
||||
- `alert` (String) The name of the alert rule. Is the identifier and must be unique in the group.
|
||||
- `expression` (String) The LogQL expression to evaluate. Every evaluation cycle this is evaluated at the current time, and all resultant time series become pending/firing alerts.
|
||||
|
||||
Optional:
|
||||
|
||||
- `annotations` (Map of String) A map of key:value. Annotations to add or overwrite for each alert
|
||||
- `for` (String) Alerts are considered firing once they have been returned for this long. Alerts which have not yet fired for long enough are considered pending. Default is 0s
|
||||
- `labels` (Map of String) A map of key:value. Labels to add or overwrite for each alert
|
||||
Loading…
Add table
Add a link
Reference in a new issue