You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(tutorials): migrate alerting tutorials to redis as a Resource
The gcp-microservices-demo sample moves its Redis cache from a Component to a Resource of type ClusterResourceType/valkey. The two alerting tutorials reference that sample and need to keep up.
- component-alerts-and-incidents.mdx: drop the removed redis-component.yaml from the kubectl apply block and add the Resource provisioning + promote step before the components apply. Redis was incidental to this tutorial (alerts target frontend / recommendation / cart).
- configure-budget-alert-and-cost-analysis.mdx: same apply-block update, plus pivot the budget alert target from redis to productcatalog throughout Steps 4-6 (heading, trait instance name, ReleaseBinding name, prose). Resources don't accept componentTypeEnvironmentConfigs cost overrides, so the alert needs a Component target; productcatalog also avoids stepping on the alerts tutorial's already-touched components.
Signed-off-by: Miraj Abeysekara <miraj@wso2.com>
### Step 4: Define a Budget Alert Rule for the Redis Component
409
+
### Step 4: Define a Budget Alert Rule for the Product Catalog Component
405
410
406
411
Developers attach the budget alert rule as a trait to the component once. The alert rule automatically propagates to all environments as the component is promoted.
407
412
408
-
In this step we attach a budget-based alert to the `redis` component:
413
+
In this step we attach a budget-based alert to the `productcatalog` component:
409
414
410
-
- Trigger: cost of the redis component exceeds USD 2 in 5 minutes
411
-
- Trait instance name: `redis-budget-alert`
415
+
- Trigger: cost of the productcatalog component exceeds USD 2 in 5 minutes
OpenCost calculates component cost based on the configured per-unit prices of CPU and memory on the underlying nodes. With the default pricing values, the projected cost of the `redis` component grows very slowly, so a budget alert with a low threshold (USD 2) can take a long time to fire during testing.
474
+
OpenCost calculates component cost based on the configured per-unit prices of CPU and memory on the underlying nodes. With the default pricing values, the projected cost of the `productcatalog` component grows very slowly, so a budget alert with a low threshold (USD 2) can take a long time to fire during testing.
470
475
471
476
To make the budget alert trigger within a few minutes, temporarily override OpenCost's custom pricing model with significantly inflated CPU and RAM prices, then restart the OpenCost deployment so the new values take effect:
472
477
@@ -488,7 +493,7 @@ This change is purely for accelerating the test scenario in this tutorial. Rever
488
493
489
494
This step creates a `ReleaseBinding` that:
490
495
491
-
- Deliberately inflates the `redis` component's CPU and memory requests/limits in the `development` environment so the projected cost crosses the USD 2 threshold within a few minutes
496
+
- Deliberately inflates the `productcatalog` component's CPU and memory requests/limits in the `development` environment so the projected cost crosses the USD 2 threshold within a few minutes
492
497
- Configures the budget alert for the `development` environment via `traitEnvironmentConfigs`:
493
498
- Enables the alert rule
494
499
- Selects the webhook notification channel
@@ -500,16 +505,16 @@ Apply the scenario:
500
505
```bash
501
506
kubectl apply -f - <<'EOF'
502
507
---
503
-
# ReleaseBinding for redis component with oversized resource requests/limits to trigger a budget alert
508
+
# ReleaseBinding for productcatalog component with oversized resource requests/limits to trigger a budget alert
504
509
apiVersion: openchoreo.dev/v1alpha1
505
510
kind: ReleaseBinding
506
511
metadata:
507
-
name: redis-development
512
+
name: productcatalog-development
508
513
namespace: default
509
514
spec:
510
515
owner:
511
516
projectName: gcp-microservice-demo
512
-
componentName: redis
517
+
componentName: productcatalog
513
518
environment: development
514
519
componentTypeEnvironmentConfigs:
515
520
resources:
@@ -520,7 +525,7 @@ spec:
520
525
cpu: "1000m"
521
526
memory: "1000Mi"
522
527
traitEnvironmentConfigs:
523
-
redis-budget-alert:
528
+
productcatalog-budget-alert:
524
529
enabled: true
525
530
actions:
526
531
notifications:
@@ -538,7 +543,7 @@ EOF
538
543
539
544
### Step 7: Verify the Budget Alert and AI Cost Analysis
540
545
541
-
Within a few minutes of applying the redis`ReleaseBinding`, the `redis-budget-alert` should fire because the inflated CPU/memory requests push the cost above the threshold.
546
+
Within a few minutes of applying the productcatalog`ReleaseBinding`, the `productcatalog-budget-alert` should fire because the inflated CPU/memory requests push the cost above the threshold.
542
547
543
548
- Confirm alert delivery to the configured webhook notification channel.
544
549
- Confirm that an incident was created for the budget alert in the Backstage portal.
@@ -548,7 +553,7 @@ You can also acknowledge and resolve the incident via the Backstage portal once
548
553
549
554
## Summary
550
555
551
-
You attached a **budget-based observability alert rule** to the `redis` component (as an `observability-alert-rule` trait), configured a **webhook notification channel**, and enabled **incident creation** and **AI cost analysis** via `ReleaseBinding``traitEnvironmentConfigs`.
556
+
You attached a **budget-based observability alert rule** to the `productcatalog` component (as an `observability-alert-rule` trait), configured a **webhook notification channel**, and enabled **incident creation** and **AI cost analysis** via `ReleaseBinding``traitEnvironmentConfigs`.
552
557
553
558
Then you triggered the budget alert using a controlled cost-overrun scenario and verified that the **FinOps Agent** produced an AI cost analysis report with an actionable rightsizing recommendation.
0 commit comments