> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cloudthinker.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Cost Analytics

> Real-time spending analysis, forecasting, and cost attribution across your cloud infrastructure

CloudThinker provides comprehensive cost analytics to help you understand spending patterns, identify anomalies, and forecast future costs across all connected cloud accounts.

***

## Why Cost Analytics, Not Just Cost Visibility

AWS Cost Explorer shows you your bill. CloudThinker helps you understand it and act on it.

The difference: Cost Explorer requires you to build the right filters, choose the right grouping dimensions, and manually compare time periods to spot anomalies. If your bill increases by \$15,000 this month, you need to navigate to each service, check each region, and manually piece together what changed.

CloudThinker cost analytics answers the question directly: `@alex what drove our $15K cost increase this month?` — and gives you a structured breakdown with the top drivers, root cause analysis, and recommended actions.

***

## Analytics Dashboard

The Cost Analytics dashboard provides a unified view of your cloud spending:

<CardGroup cols={2}>
  <Card title="Spending Overview" icon="dollar-sign">
    Current period spend, month-to-date totals, and projected end-of-month costs
  </Card>

  <Card title="Trend Analysis" icon="chart-line-up">
    Historical spending patterns with daily, weekly, and monthly views
  </Card>

  <Card title="Cost Drivers" icon="arrow-trend-up">
    Top services and resources contributing to your cloud bill
  </Card>

  <Card title="Anomaly Detection" icon="triangle-exclamation">
    Automatic identification of unusual spending patterns
  </Card>
</CardGroup>

***

## Cost Attribution

Understand where your money goes with multi-dimensional cost attribution:

### By Service

View spending breakdown by cloud service:

* Compute (EC2, Lambda, ECS, etc.)
* Storage (S3, EBS, EFS)
* Database (RDS, DynamoDB, etc.)
* Networking (CloudFront, VPC, etc.)
* Analytics and AI services

### By Resource

Drill down to individual resource costs:

* Instance-level spending
* Storage volume costs
* API call charges
* Data transfer fees

### By Tag

Group costs by your tagging strategy:

* Environment (production, staging, development)
* Team or department
* Project or application
* Cost center

### By Account

For multi-account setups:

* Account-level totals
* Cross-account comparison
* Linked account attribution

***

## Generating Cost Dashboards

Use [Alex](/guide/agents/alex) to create custom cost dashboards:

```bash theme={null}
# Basic spending overview
@alex #dashboard current month cloud spending

# Service-level breakdown
@alex #dashboard spending by AWS service for last quarter

# Environment comparison
@alex #dashboard compare production vs development costs

# Trend analysis
@alex #dashboard weekly spending trends for the past 6 months

# Resource-specific analysis
@alex #dashboard EC2 spending by instance type
```

***

## Cost Forecasting

CloudThinker uses machine learning to forecast future costs:

### Short-Term Forecasts

* End-of-month projection based on current trajectory
* Week-over-week trend analysis
* Daily spending predictions

### Long-Term Forecasts

* Quarterly spending projections
* Annual budget forecasting
* Growth-adjusted predictions

```bash theme={null}
# Get spending forecast
@alex forecast cloud spending for the next quarter

# Budget comparison
@alex compare projected spending against quarterly budget
```

***

## Anomaly Detection

CloudThinker automatically detects spending anomalies:

### Types of Anomalies

| Type                   | Description                                        |
| ---------------------- | -------------------------------------------------- |
| **Spike**              | Sudden increase in spending above normal variance  |
| **Sustained Increase** | Gradual upward trend exceeding historical patterns |
| **New Service**        | Charges from previously unused services            |
| **Resource Explosion** | Rapid increase in resource count                   |

### Anomaly Alerts

Configure alerts for spending anomalies:

1. Navigate to **[Notifications](/guide/notifications)** in your workspace
2. Create an alert rule for cost anomalies
3. Set threshold conditions (percentage or absolute)
4. Choose notification channels (email, Slack, webhook)

```bash theme={null}
# Investigate a spending anomaly
@alex analyze the cost spike on January 15th

# Identify root cause
@alex what caused the 40% increase in EC2 spending last week?
```

***

## High-Consuming Services

The analytics dashboard highlights your top cost drivers:

### Dashboard Widgets

* **Top 10 Services**: Services with highest monthly spend
* **Fastest Growing**: Services with highest percentage increase
* **Cost Per Unit**: Normalized costs (e.g., cost per GB, cost per request)

### Drill-Down Analysis

```bash theme={null}
# Analyze top services
@alex show top 5 spending services with breakdown

# Investigate specific service
@alex analyze S3 costs by bucket and storage class

# Compare services
@alex compare EC2 vs Lambda costs for compute workloads
```

***

## Data Export

Export cost data for external analysis:

### Export Formats

* **CSV**: For spreadsheet analysis
* **Excel**: Formatted workbooks with multiple sheets
* **JSON**: For programmatic processing

### Export Options

* Date range selection
* Dimension filtering (service, account, tag)
* Aggregation level (daily, weekly, monthly)

```bash theme={null}
# Generate cost report
@alex #report export last quarter's costs by service to CSV

# Detailed breakdown
@alex #report generate monthly cost allocation report
```

***

## Multi-Cloud Analytics

Unified cost view across cloud providers:

### Cross-Cloud Comparison

* Normalized service categories
* Currency conversion
* Provider-level totals

### Provider-Specific Views

* AWS Cost Explorer integration
* GCP Billing data
* Azure Cost Management data

```bash theme={null}
# Multi-cloud overview
@alex #dashboard compare AWS vs GCP spending this month

# Workload comparison
@alex analyze compute costs across all cloud providers
```

***

## Integration with Cost Optimization

Cost analytics directly feeds the recommendation engine:

1. **Pattern Detection**: Analytics identifies utilization patterns
2. **Opportunity Identification**: High-cost areas trigger optimization analysis
3. **Impact Measurement**: Track actual savings after implementation
4. **Continuous Improvement**: Refine forecasts based on implemented changes

<CardGroup cols={2}>
  <Card title="Recommendations" icon="lightbulb" href="/guide/cost-optimization/recommendations">
    Act on cost insights with AI-generated recommendations
  </Card>

  <Card title="Savings Tracking" icon="chart-pie" href="/guide/cost-optimization/savings">
    Measure the impact of your optimization efforts
  </Card>
</CardGroup>
