Query your metrics with CloudWatch Metrics Insights - Amazon CloudWatch
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Query your metrics with CloudWatch Metrics Insights

CloudWatch Metrics Insights is a powerful high-performance SQL query engine that you can use to query your metrics at scale. You can identify trends and patterns within all of your CloudWatch metrics in real time.

You can also set alarms on any Metrics Insights queries that return a single time series. This can be especially useful to create alarms that watch aggregated metrics across a fleet of your infrastructure or applications. Create the alarm once, and it dynamically adjusts as resources are added to or removed from the fleet.

You can perform a Metrics Insights query using the CloudWatch console, or by using GetMetricData or PutDashboard using the Amazon CLI or the Amazon SDKs. Queries run in the console are free of charge. For more information about CloudWatch pricing, see Amazon CloudWatch Pricing.

When you use the CloudWatch console, you can choose from a wide variety of pre-built sample queries and also create your own queries. When you create a query, you can use both a builder view that interactively prompts you and lets you browse through your existing metrics and dimensions to easily build a query, and an editor view to write queries from scratch, edit the queries you build in the builder view, and edit sample queries to customize them.

With Metrics Insights you can run queries at scale. By using the GROUP BY clause, you can flexibly group your metrics in real time into separate time series per specific dimension value, based on your use cases. Because Metrics Insights queries include an ORDER BY ability, you can use Metrics Insights to make "Top N" type queries that can scan millions of metrics in your account, and return the top 10 most CPU consuming instances, for example, to help you pinpoint and remedy latency issues in your applications.