Capacity Planning
The CapacityPlanningController provides resource utilization analysis and capacity forecasting. It helps platform operators understand current resource consumption, predict when capacity limits will be reached, and plan infrastructure scaling.
Resource Utilization
Endpoint: GET /api/v1/observability/capacity/utilization
Returns current resource utilization across the tenant's services.
ResourceUtilization Structure
| Field | Type | Description |
|---|---|---|
service | String | Service name |
cpuUtilization | double | CPU usage percentage |
memoryUtilization | double | Memory usage percentage |
diskUtilization | double | Disk usage percentage |
networkUtilization | double | Network bandwidth usage |
podCount | int | Current pod count |
maxPods | int | Maximum pods allowed |
timestamp | Instant | Measurement time |
Capacity Forecast
Endpoint: GET /api/v1/observability/capacity/forecast
Projects resource needs based on current trends.
| Parameter | Type | Default | Description |
|---|---|---|---|
horizon | String | 30d | Forecast horizon |
confidence | double | 0.95 | Confidence interval |
CapacityForecast Structure
| Field | Type | Description |
|---|---|---|
resource | String | Resource type (cpu, memory, storage) |
currentUsage | double | Current usage |
forecastedUsage | double | Projected usage at horizon |
timeToExhaustion | String | Estimated time until capacity is full |
confidenceInterval | Object | Low and high bounds |
recommendation | String | Scaling recommendation |
dataPoints | List | Forecast time series data |
Capacity Plans
Create Capacity Plan
Endpoint: POST /api/v1/observability/capacity/plans
curl -X POST http://localhost:8088/api/v1/observability/capacity/plans \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${TOKEN}" \
-H "X-Tenant-ID: 550e8400" \
-d '{
"name": "Q2 2026 Scaling Plan",
"targetDate": "2026-06-30",
"growthRate": 0.15,
"services": ["ai-service", "query-engine"],
"constraints": {
"maxBudget": 50000,
"maxCpuCores": 100,
"maxMemoryGb": 512
}
}'CapacityPlan Structure
| Field | Type | Description |
|---|---|---|
id | String | Plan identifier |
name | String | Plan name |
targetDate | LocalDate | Target date for capacity needs |
growthRate | double | Expected growth rate |
services | List | Services included in the plan |
constraints | Object | Budget and resource constraints |
recommendations | List | Scaling recommendations |
estimatedCost | BigDecimal | Projected cost for the plan |
status | String | draft, approved, executing, completed |
Scaling Recommendations
The capacity planning engine generates recommendations based on utilization trends:
| Recommendation | Trigger |
|---|---|
| Scale up | Resource utilization consistently above 80% |
| Scale down | Resource utilization consistently below 30% |
| Right-size | Resource requests significantly different from actual usage |
| Add replicas | Approaching pod count limits |
| Upgrade tier | Approaching quota limits |