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:
| Activity | Metric | What It Measures |
|---|---|---|
| Investigations | ConsumedInvestigationTime | Time spent diagnosing incidents triggered by alerts |
| Evaluations | ConsumedEvaluationTime | Time 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.comIf 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
- Open the CloudWatch Console
- In the left navigation, choose Metrics → All metrics
- In the search box, type
AWS/AIDevOpsand select the namespace - Choose By AgentSpace — you'll see metrics listed per agent space
- Select the checkboxes for:
ConsumedInvestigationTimeConsumedEvaluationTimeConsumedChatRequests
- In the Graphed metrics tab above the graph:
- Change Statistic to
Sum - Change Period to
1 Houror1 Day
- Change Statistic to
- Adjust the time range at the top to
1d(last 24 hours) or1w(last week)
You'll see the total seconds consumed per metric plotted over time.
Tip: If you don't seeConsumedInvestigationTimeorConsumedEvaluationTimein the list, your agent hasn't performed any billable work yet - trigger a chat or investigation first.
Note:ConsumedEvaluationTimeonly appears after the agent runs its first evaluation (proactive scheduled assessment). If you've only used chat or investigations, you'll only seeConsumedInvestigationTime. 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.498with 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
- From the All metrics view (Step 1), with
ConsumedInvestigationTimeandConsumedEvaluationTimeselected - Click the Graphed metrics tab
- Click Add math → Start with empty expression
- Add these expressions one by one (click Add math for each):
| ID | Expression | Label |
|---|---|---|
e1 | m1 + m2 | Total Billable Seconds |
e2 | (m1 + m2) / 60 | Billable Minutes |
e3 | ((m1 + m2) / 60) * 0.498 | Estimated Cost ($) |
m1= your ConsumedInvestigationTime metricm2= your ConsumedEvaluationTime metric- (Check the Id column to confirm which is m1 and m2)
- Uncheck the visibility (eye icon) on m1 and m2 if you only want to see the cost line
- The graph now shows your estimated cost over time
Save as Dashboard
- Click Actions → Add to dashboard
- Choose an existing dashboard or create
DevOpsAgent-CostTracker - 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
- Open CloudWatch Console → Alarms → All alarms
- Click Create alarm
- Click Select metric → search
AWS/AIDevOps→ selectConsumedInvestigationTime(Sum) - Click Select metric, then click Add math → Start with empty expression
- Add a second metric:
ConsumedEvaluationTime(Sum) — note its ID (e.g., m2) - Add expression:
((m1+m2)/60)*0.498with labelDailyCost - Important: Uncheck the checkbox on m1 and m2 rows (only the expression should be checked for alarm evaluation)
- Set Period to
1 Day - Click Next
- Configure threshold:
- Whenever DailyCost is > than → enter
16.67(=$500/month ÷ 30 days) - Treat missing data as →
Not breaching
- Whenever DailyCost is > than → enter
- Click Next → select or create an SNS topic for notifications (email/Slack)
- Click Next → name it
DevOpsAgent-MonthlyBudget-500 - 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
- Open AWS Budgets Console
- Click Create budget
- Choose Cost budget
- Set monthly budget amount (e.g., $500)
- Under Filters, select Service = AWS DevOps Agent
- Configure alert thresholds: 50%, 80%, 100%
- Add email recipients
- Click Create budget
Which to Choose?
| Approach | Latency | Granularity | Best For |
|---|---|---|---|
| CloudWatch Alarm (Option A) | Real-time (5 min) | Per agent space, per hour | Engineering teams wanting immediate alerts |
| AWS Budgets (Option B) | 12-24 hours | Account-level, monthly | Finance/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
- In CloudWatch → Metrics → All metrics → AWS/AIDevOps → By AgentSpace
- You'll see each metric listed separately per
AgentSpaceUUID - Select
ConsumedInvestigationTimefor each agent space you want to compare - In the Graphed metrics tab, set Statistic to
Sumand Period to1 Hour - 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:
- In the Graphed metrics tab, click Add math → Search
- Enter:
SEARCH('{AWS/AIDevOps,AgentSpaceUUID} MetricName="ConsumedInvestigationTime"', 'Sum', 3600) - 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
- Metrics are free - DevOps Agent vends
ConsumedInvestigationTimeandConsumedEvaluationTimeto CloudWatch at no extra charge - Math is simple - Total cost = (Investigation seconds + Evaluation seconds) ÷ 60 × $0.498
- Alarm early - Set a daily-rate alarm at (monthly budget ÷ 30) for real-time overspend detection
- Break down by space - Use
AgentSpaceUUIDdimension to attribute costs to teams - Don't forget credits - Support plan credits offset most or all charges for many customers
Next Steps
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article