Menu

AWS FinOps Field Notes: Detecting CPU Credit Depletion and Runaway Dev Workloads
📰

AWS FinOps Field Notes: Detecting CPU Credit Depletion and Runaway Dev Workloads

DEV Community: python·Ace7-coder·about 12 hours ago
#UbVu01xq
#devtopython#devto#dev#account#cloud
Reading 0:00
15s threshold

While auditing cloud infrastructure costs this week, recurring configuration gaps continue to quietly inflate monthly bills.

Field Insight: The Hidden Cost Trap

Preview app workers stuck in OOM-kill loops burning CPU credits, combined with unoptimized logging clients streaming request bodies that silently double monthly cloud costs.

Automated Detection: Flagging Exhausted T-Series CPU Credits with Boto3

import boto3 from datetime import datetime , timedelta , timezone

def audit_cpu_credits ( region = 'us-east-1' ) : cw = boto3 . client ( 'cloudwatch' , region_name = region ) ec2 = boto3 . client ( 'ec2' , region_name = region ) now = datetime . now ( timezone . utc ) one_day_ago = now - timedelta ( days = 1 )

reservations = ec2 . describe_instances ( Filters = [ { 'Name' : 'instance-state-name' , 'Values' : [ 'running' ] } ] ) . get ( 'Reservations' , [ ] )

flagged = [ ] for r in reservations : for inst in r [ 'Instances' ] : i_type = inst [ 'InstanceType' ] if not i_type .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.