Skip to main content

Cost Analysis & Reports

The Cost Explorer provides methods for analyzing infrastructure costs, workflow execution costs, and combined cost views. All cost data flows through the backend service which integrates with AWS Cost Explorer, and is cached for fast access to minimize API calls.

Cost Data Sources

Cost data is aggregated from two primary sources:

SourceDescription
Infrastructure costsAWS Cost Explorer data covering EC2, RDS, S3, EKS, and other AWS services
Execution costsWorkflow execution costs tracked by the platform's workflow engine

The combined costs view merges both sources for a complete picture of platform spending.

Cost Explorer Methods

All Cost Explorer methods require admin role access. Data is served from cache when available, with fallback to the backend API for fresh data.

Get All Cached Data

Retrieve all cached cost data in a single call:

costExplorer.getAllData(months = 12)

Returns a combined object with all available cached data:

FieldDescription
monthlyCostsMonthly cost breakdown by service
dailyCostsDaily cost breakdown
predictionsML-based cost forecasts
serviceBreakdownCost distribution across AWS services
anomaliesDetected cost anomalies

The method first checks for typed cache documents (monthly, daily, predictions, service_breakdown, anomalies) and falls back to legacy aws-costs cache entries for backward compatibility.

Monthly Costs

costExplorer.getMonthlyCosts(months = 12)
ParameterDefaultDescription
months12Number of months of history to return

Returns monthly cost breakdown by service, fetched from the backend endpoint GET /api/v1/finops/monthly-costs.

Daily Costs

costExplorer.getDailyCosts(days = 30)
ParameterDefaultDescription
days30Number of days of history to return

Returns granular daily spending data, fetched from the backend endpoint GET /api/v1/finops/daily-costs.

Cost Forecast

costExplorer.getCostForecast(monthsAhead = 3)
ParameterDefaultDescription
monthsAhead3Number of months to forecast

Returns ML-based cost predictions with confidence intervals, fetched from the backend endpoint GET /api/v1/finops/cost-forecast.

Service Breakdown

costExplorer.getServiceBreakdown(startDate, endDate)
ParameterDescription
startDateStart date for the breakdown period (string)
endDateEnd date for the breakdown period (string)

Returns cost distribution across AWS services for the specified date range, fetched from the backend endpoint GET /api/v1/finops/service-breakdown.

Savings Recommendations

costExplorer.getSavingsRecommendations()

Returns AWS optimization recommendations from the backend endpoint GET /api/v1/finops/savings-recommendations. These recommendations are generated by AWS and may include right-sizing suggestions, reserved instance recommendations, and unused resource identification.

Cost Anomalies

costExplorer.getCostAnomalies()

Returns detected cost anomalies from the backend endpoint GET /api/v1/finops/cost-anomalies. Anomalies are statistically identified cost spikes that deviate from normal spending patterns.

Execution Costs

costExplorer.getExecutionCosts(months = 12, year = null)
ParameterDefaultDescription
months12Number of months of history
yearnullOptional specific year to query

Returns workflow execution cost tracking data from the backend endpoint GET /api/v1/finops/execution-costs. This covers costs directly associated with running workflows on the platform.

Combined Costs

costExplorer.getCombinedCosts(months = 12)
ParameterDefaultDescription
months12Number of months of history

Returns infrastructure costs combined with execution costs from the backend endpoint GET /api/v1/finops/combined-costs. This provides the most complete view of total platform spending.

Cache Management

Cost data is cached for fast access to minimize AWS API calls. Each cache entry has a type field identifying the data category and a data field containing the cached response.

Cache Types

Cache TypeDescription
monthlyMonthly cost data, keyed by timeRange
dailyDaily cost data, keyed by timeRange
predictionsCost forecast data
service_breakdownService-level cost breakdown
anomaliesDetected cost anomalies
aws-costsLegacy combined cache entry (backward compatibility)

Triggering a Cache Refresh

costExplorer.triggerCacheRefresh()

This method triggers a background cache refresh via the backend API endpoint POST /api/v1/finops/cache/trigger-refresh. The refresh is fire-and-forget -- the method returns immediately while the backend processes the refresh asynchronously.

Returns:

{
"success": true,
"message": "Cache refresh triggered in background"
}

Refreshing via the UI

  1. Navigate to the FinOps dashboard
  2. Click the Refresh button
  3. The system triggers a background cache refresh
  4. New data appears on the dashboard once the refresh completes

Analyzing Cost Data

The monthly costs view shows:

  • Total cost per month broken down by AWS service
  • Month-over-month percentage changes
  • Top services contributing to costs
  • Historical spending patterns over the selected time range

Daily Cost Breakdown

The daily costs view provides:

  • Granular day-by-day spending
  • Day-of-week patterns
  • Identification of cost spikes on specific dates
  • Short-term trend analysis

Service-Level Analysis

The service breakdown shows cost distribution across AWS services for a custom date range:

  • Per-service cost totals
  • Percentage of total spend per service
  • Comparison between current and previous period
  • Identification of the most expensive services

Cost Forecasting

The ML-based cost forecast provides:

  • Projected costs for the next 1-3 months
  • Confidence intervals (upper and lower bounds)
  • Trend direction and magnitude
  • Comparison of projected versus budgeted amounts

Cost Anomalies

Anomaly detection identifies unusual cost patterns:

  • Date and duration of each anomaly
  • Which AWS service caused the anomaly
  • Expected versus actual cost
  • Dollar magnitude of the deviation

Combining Infrastructure and Execution Costs

The combined costs view merges AWS infrastructure costs with workflow execution costs to provide full visibility into platform spending. This is particularly useful for:

  • Understanding the total cost of running workflows (infrastructure + compute)
  • Identifying whether cost increases are driven by infrastructure or execution volume
  • Planning capacity based on both infrastructure and workload trends

Backend API Endpoints

The platform proxies all cost requests to the backend:

EndpointMethodDescription
/api/v1/finops/monthly-costsGETMonthly cost breakdown by service
/api/v1/finops/daily-costsGETDaily cost breakdown
/api/v1/finops/cost-forecastGETML-based cost predictions
/api/v1/finops/service-breakdownGETService-level cost breakdown for a date range
/api/v1/finops/savings-recommendationsGETAWS optimization recommendations
/api/v1/finops/cost-anomaliesGETDetected cost anomalies
/api/v1/finops/execution-costsGETWorkflow execution cost tracking
/api/v1/finops/combined-costsGETCombined infrastructure + execution costs
/api/v1/finops/cache/trigger-refreshPOSTTrigger background cache refresh

The backend URL is configured during platform deployment.

Best Practices

Review Costs Regularly

  • Check the cost dashboard weekly to identify trends
  • Review daily costs when investigating anomalies
  • Use the service breakdown to find the most expensive services

Use Forecasting for Planning

  • Compare forecasts against budget allocations
  • Investigate discrepancies between predicted and actual costs
  • Use forecast confidence intervals when setting budget thresholds

Monitor Anomalies Proactively

  • Investigate all cost anomalies promptly
  • Determine whether anomalies are caused by expected events (deployments, scaling) or unexpected issues
  • Set budget alerts at appropriate thresholds based on historical anomaly patterns

Refresh Cache Appropriately

  • Cost data is cached to minimize AWS API costs
  • Refresh the cache when you need current data for decision-making
  • Avoid excessive refreshes as each triggers AWS Cost Explorer API calls
tip

Use the costExplorer.getAllData method to fetch all cached cost data in a single call. This is more efficient than making separate calls for each data type and provides a complete snapshot for dashboard rendering.