AWS Builder Center

Tracking AWS DevOps Agent Costs: Calculate Billable Hours Using CloudWatch Metrics, Math Expressions, and Budget Alarms

AWS DevOps Agent bills per second of active agent time — no upfront costs, no idle charges. But as your team scales from one agent space to many, a common question arises: *"How much are we actually spending, and how do I prevent surprise bills?"*

AWS DevOps Agent bills per second of active agent time - no upfront costs, no idle charges. But as your team scales from one agent space to many, a common question arises: "How much are we actually spending, and how do I prevent surprise bills?"
The answer lives in CloudWatch. DevOps Agent automatically vends usage metrics to the AWS/AIDevOps namespace in your account. With the right metric math expressions and alarms, you can build a real-time cost tracking dashboard - no custom code needed.
In this post, you'll learn how to:
  • Query DevOps Agent's vended CloudWatch metrics to calculate billable seconds
  • Use metric math expressions to convert raw seconds into estimated dollar costs
  • Set up budget alarms to alert before you exceed your spending threshold

Understanding DevOps Agent Pricing

AWS DevOps Agent charges $0.498 per agent-minute ($0.0083 per agent-second). Agent time is the cumulative duration the agent spends actively working on a task — investigations and evaluations. Idle time is free.
There are two billable activity types:
ActivityMetricWhat It Measures
InvestigationsConsumedInvestigationTimeTime spent diagnosing incidents triggered by alerts
EvaluationsConsumedEvaluationTimeTime spent on proactive assessments and recommendations
Both metrics are published every 5 minutes under the AWS/AIDevOps namespace, dimensioned by AgentSpaceUUID.
Note: Customers on paid AWS Support plans (Business, Enterprise On-Ramp, Enterprise) receive monthly credits that offset DevOps Agent charges. Factor this into your net cost calculation.

Prerequisites

Before metrics will publish, ensure the AWSServiceRoleForAIDevOps service-linked role exists in your account. If your agent spaces were created before March 13, 2026, you must create it manually:
1
aws iam create-service-linked-role --aws-service-name aidevops.amazonaws.com
If the role already exists, you'll receive an error - that's expected and means you're good to go. Without this role, billing metrics (ConsumedInvestigationTime, ConsumedEvaluationTime, ConsumedChatRequests) will not be published even though TopologyCompletionCount may appear.

Step 1: Query Your Billable Metrics

Using the CloudWatch Console

  1. Open the CloudWatch Console 
  2. In the left navigation, choose Metrics → All metrics
  3. In the search box, type AWS/AIDevOps and select the namespace
  4. Choose By AgentSpace — you'll see metrics listed per agent space
  5. Select the checkboxes for:
    • ConsumedInvestigationTime
    • ConsumedEvaluationTime
    • ConsumedChatRequests
  6. In the Graphed metrics tab above the graph:
    • Change Statistic to Sum
    • Change Period to 1 Hour or 1 Day
  7. Adjust the time range at the top to 1d (last 24 hours) or 1w (last week)
You'll see the total seconds consumed per metric plotted over time.
Tip: If you don't see ConsumedInvestigationTime or ConsumedEvaluationTime in the list, your agent hasn't performed any billable work yet - trigger a chat or investigation first.
Note: ConsumedEvaluationTime only appears after the agent runs its first evaluation (proactive scheduled assessment). If you've only used chat or investigations, you'll only see ConsumedInvestigationTime. That's normal - start with just that metric. Once evaluations run, the second metric will appear automatically. Update your math expressions to include both at that point: ((m1+m2)/60)*0.498. Until then, use (m1/60)*0.498 with just the investigation metric.

Step 2: Build a Cost Calculation with Metric Math

CloudWatch Metric Math lets you derive cost estimates directly in your dashboard — no code needed.

Console Steps

  1. From the All metrics view (Step 1), with ConsumedInvestigationTime and ConsumedEvaluationTime selected
  2. Click the Graphed metrics tab
  3. Click Add math → Start with empty expression
  4. Add these expressions one by one (click Add math for each):
IDExpressionLabel
e1m1 + m2Total Billable Seconds
e2(m1 + m2) / 60Billable Minutes
e3((m1 + m2) / 60) * 0.498Estimated Cost ($)
  • m1 = your ConsumedInvestigationTime metric
  • m2 = your ConsumedEvaluationTime metric
  • (Check the Id column to confirm which is m1 and m2)
  1. Uncheck the visibility (eye icon) on m1 and m2 if you only want to see the cost line
  2. The graph now shows your estimated cost over time

Save as Dashboard

  1. Click Actions → Add to dashboard
  2. Choose an existing dashboard or create DevOpsAgent-CostTracker
  3. Click Add to dashboard
You now have a persistent cost widget that updates automatically.

Step 3: Set Up Budget Alarms

Option A: CloudWatch Alarm via Console

  1. Open CloudWatch Console  → Alarms → All alarms
  2. Click Create alarm
  3. Click Select metric → search AWS/AIDevOps → select ConsumedInvestigationTime (Sum)
  4. Click Select metric, then click Add math → Start with empty expression
  5. Add a second metric: ConsumedEvaluationTime (Sum) — note its ID (e.g., m2)
  6. Add expression: ((m1+m2)/60)*0.498 with label DailyCost
  7. Important: Uncheck the checkbox on m1 and m2 rows (only the expression should be checked for alarm evaluation)
  8. Set Period to 1 Day
  9. Click Next
  10. Configure threshold:
    • Whenever DailyCost is > than → enter 16.67 (=$500/month ÷ 30 days)
    • Treat missing data as → Not breaching
  11. Click Next → select or create an SNS topic for notifications (email/Slack)
  12. Click Next → name it DevOpsAgent-MonthlyBudget-500
  13. Click Create alarm
Logic: $500/month budget ÷ 30 days = ~$16.67/day. If any day exceeds this rate, you get alerted.

Option B: AWS Budgets

  1. Open AWS Budgets Console 
  2. Click Create budget
  3. Choose Cost budget
  4. Set monthly budget amount (e.g., $500)
  5. Under Filters, select Service = AWS DevOps Agent
  6. Configure alert thresholds: 50%, 80%, 100%
  7. Add email recipients
  8. Click Create budget

Which to Choose?

ApproachLatencyGranularityBest For
CloudWatch Alarm (Option A)Real-time (5 min)Per agent space, per hourEngineering teams wanting immediate alerts
AWS Budgets (Option B)12-24 hoursAccount-level, monthlyFinance/management cost governance
Recommendation: Use both. CloudWatch alarms for real-time engineering awareness, Budgets for monthly governance.

Step 4: Per-Agent-Space Cost Breakdown

If you run multiple agent spaces (e.g., per-team or per-environment), you can view costs per space.

Console Steps

  1. In CloudWatch → Metrics → All metrics → AWS/AIDevOps → By AgentSpace
  2. You'll see each metric listed separately per AgentSpaceUUID
  3. Select ConsumedInvestigationTime for each agent space you want to compare
  4. In the Graphed metrics tab, set Statistic to Sum and Period to 1 Hour
  5. The graph shows a separate line per space — identify which drives the most cost

Using SEARCH Expression (Advanced)

For a dynamic view that auto-includes new agent spaces:
  1. In the Graphed metrics tab, click Add math → Search
  2. Enter: SEARCH('{AWS/AIDevOps,AgentSpaceUUID} MetricName="ConsumedInvestigationTime"', 'Sum', 3600)
  3. This returns a separate time series per agent space automatically

Dashboard Visualization Tip

Use a stacked area chart with the SEARCH expression to visualize cost distribution across agent spaces over time. This immediately answers: "Which team's agent space is costing the most?"

Complete Cost Tracking Architecture

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
┌─────────────────────────────────────────────────────┐
│ AWS DevOps Agent │
│ (Investigations + Evaluations) │
└──────────────────┬──────────────────────────────────┘
│ Vended metrics (every 5 min)
▼
┌─────────────────────────────────────────────────────┐
│ CloudWatch (AWS/AIDevOps namespace) │
│ │
│ ConsumedInvestigationTime (Seconds, per space) │
│ ConsumedEvaluationTime (Seconds, per space) │
│ ConsumedChatRequests (Count, per space) │
└───┬────────────────┬────────────────┬───────────────┘
│ │ │
▼ ▼ ▼
┌────────┐ ┌───────────┐ ┌──────────────┐
│Dashboard│ │Metric Math│ │ CloudWatch │
│(visual) │ │ Alarm │ │ Logs Insights│
│ │ │(real-time)│ │ (deep dive) │
└────────┘ └─────┬─────┘ └──────────────┘
│
▼
┌──────────┐
│ SNS Topic│──→ Email / Slack / PagerDuty
└──────────┘

Key Takeaways

  1. Metrics are free - DevOps Agent vends ConsumedInvestigationTime and ConsumedEvaluationTime to CloudWatch at no extra charge
  2. Math is simple - Total cost = (Investigation seconds + Evaluation seconds) ÷ 60 × $0.498
  3. Alarm early - Set a daily-rate alarm at (monthly budget ÷ 30) for real-time overspend detection
  4. Break down by space - Use AgentSpaceUUID dimension to attribute costs to teams
  5. Don't forget credits - Support plan credits offset most or all charges for many customers

Next Steps

Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article