MATIH Platform is in active MVP development. Documentation reflects current implementation status.
8. Platform Services
Cost Dashboard

Cost Dashboard

The CostDashboardController and CostDashboardService provide cost analytics and visualization data for tenant administrators. The dashboard aggregates billing data, usage trends, cost projections, and budget tracking into a unified view.


Dashboard Overview

Endpoint: GET /api/v1/billing/cost-dashboard/tenants/:tenantId/overview

Returns the main dashboard data including current month costs, month-over-month change, cost breakdown by category, and budget status.

curl http://localhost:8087/api/v1/billing/cost-dashboard/tenants/550e8400/overview \
  -H "Authorization: Bearer ${TOKEN}"

Cost Breakdown

Endpoint: GET /api/v1/billing/cost-dashboard/tenants/:tenantId/breakdown

Returns cost breakdown by metric type, cost center, and time period.

ParameterTypeDefaultDescription
startDateLocalDateStart of current monthAnalysis start date
endDateLocalDateTodayAnalysis end date
groupByStringmetricTypeGrouping: metricType, costCenter, service

Cost Trends

Endpoint: GET /api/v1/billing/cost-dashboard/tenants/:tenantId/trends

Returns historical cost data for trend analysis.

ParameterTypeDefaultDescription
monthsint6Number of months of history
granularityStringmonthlydaily, weekly, monthly

Cost Projections

Endpoint: GET /api/v1/billing/cost-dashboard/tenants/:tenantId/projections

Projects future costs based on current usage trends and growth patterns.


Budget Tracking

Endpoint: GET /api/v1/billing/cost-dashboard/tenants/:tenantId/budgets

Returns budget utilization data including:

  • Allocated budget per cost center
  • Current spend vs. budget
  • Projected end-of-month spend
  • Budget alerts (percentage of budget consumed)

Cloud Cost Integration

The CostIngestionService and CostIngestionController handle ingestion of cloud infrastructure costs from providers (Azure, AWS, GCP). These costs are combined with platform usage costs to provide a complete view of total cost of ownership.

Cloud Cost Entities

EntityDescription
CloudCostIndividual cloud cost records from provider billing
CostIngestionJobTracks the status of cost data ingestion jobs
CostAnomalyDetected anomalies in cost patterns
CostAlertCost threshold alerts
BudgetBudget definitions and tracking

Cost Anomaly Detection

The dashboard includes cost anomaly detection that identifies:

  • Unexpected cost spikes (daily cost exceeds 2x the 30-day average)
  • Unusual resource type costs
  • Cost center budget breaches
  • Unattributed costs