Repository navigation
Lab 65: Budget and Cost Alerts
Lab 65 • Practical guide
Create a monthly spending monitor with an early forecast warning and a critical actual-spend alert. This lab uses a budget of 100 in the Console's displayed currency; choose an amount appropriate for your environment.
A budget is a soft limit. Resources continue running after the threshold is crossed. An alert is a signal to investigate, not an automatic shutdown mechanism.
| Component | Lab configuration | Purpose |
|---|---|---|
| Spending scope | One compartment | Identify the resources being monitored |
| Monthly budget | 100; processing starts on day 1 | Establish a calendar-month baseline |
| Early warning | Forecast Spend at 80% | Flag projected overspending |
| Critical alert | Actual Spend at 100% | Flag incurred spending at the budget amount |
| Response owner | Your team or monitored mailbox | Ensure someone acts on the alert |
You need an OCI account, a target compartment, a budget amount, and an email address you monitor. A tenancy administrator can grant budget access using your actual group name:
Allow group BillingAdmins to manage usage-budgets in tenancy
Budget permissions belong at tenancy level: the budget resource lives in the root even when its target is a child compartment. The use permission allows creation and editing; manage also allows deletion.
Choose a compartment when ownership follows compartment boundaries. Choose a tag target when a project spans resources grouped by tags. A compartment budget includes its child compartments, so review that scope before choosing the amount.
Reference: Oracle budget concepts and IAM.
Open Navigation menu → Billing & Cost Management → Budgets, then select Create Budget.
| Field | Value to enter |
|---|---|
| Budget scope | Compartment |
| Name | prod-monthly-budget |
| Description | Production spending monitor; owner: your team |
| Target compartment | Your intended compartment |
| Schedule | Monthly |
| Budget amount | 100 |
| Day to begin processing | 1 |
Verify the currency displayed in the Console. You can choose another processing day to align with your billing cycle; monthly processing does not always begin on the first. A custom non-recurring schedule is also available for a fixed date range.
For a tag budget, specify the namespace, key, and value instead of a compartment. If the target already has a budget, open it and add alert rules rather than creating another budget for the same target.
Reference: Oracle budget creation.
Configure the optional initial alert during creation, or save the budget and open Budget Alert Rules → Create Budget Alert Rule.
| Rule | Metric | Threshold type | Value | Suggested response |
|---|---|---|---|---|
| Early warning | Forecast Spend | Percentage of Budget | 80 | Review the projected total and resource usage |
| Critical | Actual Spend | Percentage of Budget | 100 | Investigate incurred costs and agree on action |
Enter your recipient addresses, separated by commas. Add a useful email message, for example:
Production budget warning: review costs for the target compartment, identify unexpected usage, and notify the budget owner before making changes.
Select Create for each rule. If the initial rule was created with the budget, add only the second rule afterward.
Percentage versus absolute: On a budget of 100, an 80% threshold corresponds to 80. An absolute threshold stays at its specified amount if the budget amount changes; a percentage threshold scales with the budget.
Reference: Oracle alert rule creation.
Actual spending reflects costs already incurred. Forecast spending estimates the total for the period using the current spending pace:
Forecast = (Actual spend / Days processed) × Days in budget period
For example, 30 spent over 10 processed days in a 30-day period produces a forecast of 90. That would exceed this lab's 80% forecast warning even though actual spending is only 30% of the budget.
Oracle documents a minimum of three days of consumption before forecast alerts can trigger. Forecasts can move sharply when usage changes, so treat them as estimates. The alert documentation describes hourly forecast evaluation, while the budget overview describes periodic alert evaluation every 24 hours; do not expect immediate email delivery.
- Confirm the target, currency, amount, schedule, and processing day.
- Confirm both rules show the correct metric and threshold.
- Check recipient spelling and mailbox filtering.
- Review current spend, forecast, and the last evaluation information in budget details.
- Record the budget owner and the action expected for each alert.
Avoid creating paid resources solely to trigger an email. Verify the configuration first and monitor normal usage as data becomes available.
| Symptom | What to check |
|---|---|
| Cannot create or edit a budget | Confirm tenancy-level usage-budgets access with your administrator |
| Budget already exists for the target | Add rules to the existing budget |
| No forecast alert on the first day | Allow the minimum consumption history required for forecasting |
| No email despite an expected threshold | Check the metric, threshold, recipients, evaluation timing, and spam folder |
| Spending differs from your expectation | Recheck the target and whether child compartments or tagged resources are included |
| Resources still run after 100% | Expected: a budget is a soft limit; additional enforcement requires separate automation |
When an alert arrives, identify the services driving the cost, confirm whether the increase was planned, and assign an owner. Review idle resources and schedules, but check dependencies before stopping anything. Update the budget when an approved plan changes; increasing it should follow a spending decision, not merely silence a warning.
For automation, design an OCI Events rule and supported action separately. Do not assume that entering an email recipient connects the budget to Slack, Teams, or a shutdown workflow.
Revisit recipient lists and ownership whenever the team changes. Remove obsolete lab rules or budgets when the exercise is finished and they are no longer needed.
Example thresholds below are a starting point; choose values that fit your workload.