Skip to content

Commit 8173c35

Browse files
committed
Address CodeRabbit review comments on monitoring module
1 parent 314a8c0 commit 8173c35

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

modules/monitoring/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module "monitoring" {
3434

3535
## Architecture
3636

37-
```
37+
```text
3838
Prometheus (rancher-monitoring)
3939
│ evaluates PrometheusRule CRDs labelled release=rancher-monitoring
4040
@@ -253,7 +253,7 @@ A Google Chat card should appear within a few seconds.
253253
Each alert produces one card. The card structure is defined in a Go template
254254
stored in the `calert-config` Secret and rendered by calert at runtime.
255255

256-
```
256+
```text
257257
┌─────────────────────────────────────────────────────┐
258258
│ (WARNING) LonghornDiskUsageHigh | Firing │ ← header
259259
├─────────────────────────────────────────────────────┤
@@ -269,7 +269,7 @@ stored in the `calert-config` Secret and rendered by calert at runtime.
269269

270270
**"View Alert" button** is only rendered when `alertmanager_url` is set. It
271271
links to:
272-
```
272+
```text
273273
<alertmanager_url>/#/alerts?filter={alertname="<name>"}
274274
```
275275

modules/monitoring/examples/basic/main.tf

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ provider "kubernetes" {
2828
}
2929

3030
module "monitoring" {
31-
source = "github.com/wso2-enterprise/open-cloud-datacenter//modules/monitoring?ref=v0.3.0"
31+
source = "../../"
3232

3333
# Identifiers
34-
environment = "lk"
34+
environment = var.environment
3535
kubeconfig_path = var.kubeconfig_path
3636
kubeconfig_context = var.kubeconfig_context
3737

@@ -61,6 +61,11 @@ output "monitoring_resources" {
6161
}
6262
}
6363

64+
variable "environment" {
65+
type = string
66+
description = "Short environment identifier used in resource names (e.g. \"lk\")."
67+
}
68+
6469
variable "kubeconfig_path" {
6570
type = string
6671
default = "~/.kube/harvester-lk.yaml"

modules/monitoring/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ resource "kubernetes_manifest" "prometheus_rule_storage" {
486486
},
487487
{
488488
alert = "LonghornEvictionWithDegradedVolumes"
489-
expr = "longhorn_disk_eviction_requested == 1"
489+
expr = "longhorn_disk_eviction_requested == 1 and on() count(longhorn_volume_robustness{robustness=\"degraded\"}) > 0"
490490
for = "5m"
491491
labels = { severity = "critical" }
492492
annotations = {

0 commit comments

Comments
 (0)