This article is based on announcements made at AWS re:Invent 2019. Original reporting by devops.com.
AWS Bets on ML to Automate Cloud Optimization
At its re:Invent 2019 conference, Amazon Web Services (AWS) introduced two machine learning-powered tools aimed squarely at a persistent pain point for DevOps teams: the complexity of deploying efficient, cost-effective applications on the cloud. The two tools — Amazon CodeGuru and AWS Compute Optimizer — take different but complementary approaches to reducing the manual effort required to optimize cloud workloads.
Amazon CodeGuru: ML-Powered Code Profiling and Review
Amazon CodeGuru was launched as a preview service at re:Invent 2019. It uses machine learning models — trained on data gathered from thousands of open-source projects by AWS and its parent company — to perform two core functions:
- Code Review: CodeGuru automatically inspects pull requests, surfacing potential bugs, security vulnerabilities, and deviations from best practices, along with example code and links to relevant documentation.
- Code Profiling: CodeGuru continuously profiles running application code — sampling every five minutes — to identify performance bottlenecks, latency issues, and the most CPU-intensive code paths.
How CodeGuru Works
To use CodeGuru, developers insert an AWS-developed agent into their application. The service integrates with GitHub and AWS CodeCommit repositories, with support for additional repository providers planned. Once a pull request is submitted, CodeGuru automatically begins its analysis using pre-trained AI models.
Profiling results are visualized as a flame graph — a standard visualization technique that shows the relative CPU time consumed by each function in a call stack. Alongside the flame graph, CodeGuru generates human-readable recommendations pinpointing specific lines of code and suggesting concrete remediations.
Real-World Usage at Amazon
AWS CEO Andy Jassy stated at the conference that Amazon was already using CodeGuru internally across 80,000 applications, claiming infrastructure utilization improvements of up to 325% in some cases. These figures have not been independently verified.
AWS Compute Optimizer: Right-Sizing EC2 Instances with ML
AWS Compute Optimizer addresses a different but equally common problem: selecting the right EC2 instance type for a given workload. With dozens of instance families and hundreds of configurations available, matching a workload to the optimal compute resource has historically required significant expertise and trial-and-error.
Compute Optimizer analyzes:
- Current instance configuration and resource utilization
- Historical CloudWatch metrics for the workload
- Workloads running inside EC2 Auto Scaling groups
Based on this analysis, it recommends specific instance types that are projected to deliver higher performance at a lower cost. The service is accessed directly through the AWS Management Console, requiring no additional agent installation for EC2-based workloads.
Implications for DevOps Teams
Automation of the DevOps Toolchain
Both tools reflect a broader industry trend: applying ML to automate decisions that previously required experienced engineers to make manually. For DevOps teams, this can mean faster feedback loops, more consistent code quality, and reduced cloud spend — without requiring deep expertise in every AWS instance family or code profiling discipline.
Many steps in a modern CI/CD pipeline — testing, security scanning, deployment gating — are already automated. Tools like CodeGuru extend that automation into code quality and runtime performance, while Compute Optimizer extends it into infrastructure selection.
Data Access and Proprietary Code Concerns
One significant consideration for organizations evaluating CodeGuru is the level of access it requires. To perform its analysis, CodeGuru must inspect application source code and observe runtime behavior via an embedded agent. For teams working with sensitive, proprietary, or regulated codebases, this raises legitimate questions about data governance and intellectual property.
Teams that require code analysis to remain entirely within their own infrastructure may prefer to deploy open-source profiling and static analysis tools within a self-hosted CI/CD environment rather than routing code through a managed cloud service.
Multi-Cloud Considerations
Both CodeGuru and Compute Optimizer are AWS-native services. Organizations running multi-cloud or hybrid strategies will need to evaluate whether the optimization recommendations translate meaningfully to non-AWS environments, or whether complementary tools are required for workloads running on other platforms.
Summary
| Tool | Primary Use Case | Access Method | Key Output |
|---|---|---|---|
| Amazon CodeGuru | Code review and runtime profiling | GitHub / CodeCommit integration + agent | Flame graphs, code recommendations |
| AWS Compute Optimizer | EC2 instance right-sizing | AWS Management Console | Instance type recommendations |
Machine learning is increasingly embedded in the tooling DevOps engineers use every day. AWS Compute Optimizer and Amazon CodeGuru represent early examples of this shift — moving optimization decisions from spreadsheet analysis and institutional knowledge toward data-driven, continuously updated recommendations. Whether teams adopt these specific AWS services or equivalent tools, the expectation that infrastructure and code quality decisions will be informed by ML is becoming a standard part of the DevOps landscape.