Resource Management
The resource management subsystem provides quota enforcement, usage tracking, alerting, and cost analytics for tenants. It enables the platform to enforce per-tier resource limits and provide tenants with visibility into their consumption.
Components
| Component | Controller | Base Path |
|---|---|---|
| Resource Quotas | ResourceQuotaController | /api/v1/tenants/{tenantId}/quotas |
| Resource Alerts | ResourceAlertController | /api/v1/tenants/{tenantId}/alerts |
| Cost Attribution | CostAttributionController | /api/v1/cost-attribution |
| Cost Dashboard | CostDashboardController | /api/v1/cost-dashboard |
Quota System
Resource quotas enforce per-tier limits on compute, storage, API calls, and other resources. Each quota has:
- Soft limit: Triggers a warning alert when reached
- Hard limit: Blocks resource consumption when exceeded (returns
403 Forbidden) - Usage tracking: Records consumption over time for trend analysis
Alert System
The alerting subsystem monitors resource consumption and triggers alerts based on configurable rules:
- Alert Rules: Define thresholds, conditions, and notification channels
- Alert Lifecycle: Active, Acknowledged, Resolved, Suppressed
- Resolution Types: Manual, Automatic, Timeout
Cost Management
Cost attribution and dashboards provide visibility into infrastructure spending:
- Cost Attribution: Allocates shared cluster costs to individual tenants based on resource usage
- Cost Dashboard: Platform-wide and per-tenant cost visualization with trend analysis and anomaly detection
Source Files
| File | Path |
|---|---|
| Quota Controller | control-plane/tenant-service/src/main/java/com/matih/tenant/controller/ResourceQuotaController.java |
| Alert Controller | control-plane/tenant-service/src/main/java/com/matih/tenant/controller/ResourceAlertController.java |
| Cost Attribution Controller | control-plane/tenant-service/src/main/java/com/matih/tenant/controller/CostAttributionController.java |
| Cost Dashboard Controller | control-plane/tenant-service/src/main/java/com/matih/tenant/controller/CostDashboardController.java |