Table: aws_ecs_cluster_metric_cpu_utilization_daily - Query AWS ECS Cluster Metrics using SQL
The AWS ECS Cluster is a logical grouping of tasks or services. It allows you to manage and scale a set of services or tasks together in an AWS environment. The CPU Utilization Metric provides data about the CPU usage of the services or tasks in the cluster, helping you monitor and optimize resource allocation on a daily basis.
Table Usage Guide
The aws_ecs_cluster_metric_cpu_utilization_daily
table in Steampipe provides you with information about CPU utilization metrics within AWS Elastic Container Service (ECS) clusters. This table allows you, as a DevOps engineer, to query CPU utilization details on a daily basis, including the average, maximum, and minimum utilization. You can utilize this table to monitor and analyze CPU usage trends, identify potential performance issues, and optimize resource allocation. The schema outlines the various attributes of the CPU utilization metric for you, including the timestamp, period, unit, and statistical values.
Examples
Basic info
Explore the daily CPU usage patterns across your AWS ECS clusters. This can help you understand resource utilization trends and plan for capacity adjustments.
select cluster_name, timestamp, minimum, maximum, average, sample_countfrom aws_ecs_cluster_metric_cpu_utilization_dailyorder by cluster_name, timestamp;
select cluster_name, timestamp, minimum, maximum, average, sample_countfrom aws_ecs_cluster_metric_cpu_utilization_dailyorder by cluster_name, timestamp;
CPU Over 80% average
Explore instances where the average CPU utilization exceeds 80% in AWS ECS clusters. This can help in identifying potential performance issues and aid in capacity planning.
select cluster_name, timestamp, round(minimum :: numeric, 2) as min_cpu, round(maximum :: numeric, 2) as max_cpu, round(average :: numeric, 2) as avg_cpu, sample_countfrom aws_ecs_cluster_metric_cpu_utilization_dailywhere average > 80order by cluster_name, timestamp;
select cluster_name, timestamp, round(minimum, 2) as min_cpu, round(maximum, 2) as max_cpu, round(average, 2) as avg_cpu, sample_countfrom aws_ecs_cluster_metric_cpu_utilization_dailywhere average > 80order by cluster_name, timestamp;
CPU daily average < 1%
Identify instances where the average daily CPU utilization of AWS ECS clusters is less than 1%. This can help in understanding underutilized resources and potentially save costs by downsizing or eliminating unnecessary clusters.
select cluster_name, timestamp, round(minimum :: numeric, 2) as min_cpu, round(maximum :: numeric, 2) as max_cpu, round(average :: numeric, 2) as avg_cpu, sample_countfrom aws_ecs_cluster_metric_cpu_utilization_dailywhere average < 1order by cluster_name, timestamp;
select cluster_name, timestamp, round(minimum, 2) as min_cpu, round(maximum, 2) as max_cpu, round(average, 2) as avg_cpu, sample_countfrom aws_ecs_cluster_metric_cpu_utilization_dailywhere average < 1order by cluster_name, timestamp;
Schema for aws_ecs_cluster_metric_cpu_utilization_daily
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
account_id | text | =, !=, ~~, ~~*, !~~, !~~* | The AWS Account ID in which the resource is located. |
average | double precision | The average of the metric values that correspond to the data point. | |
cluster_name | text | A user-generated string that you use to identify your cluster. | |
maximum | double precision | The maximum metric value for the data point. | |
metric_name | text | The name of the metric. | |
minimum | double precision | The minimum metric value for the data point. | |
namespace | text | The metric namespace. | |
partition | text | The AWS partition in which the resource is located (aws, aws-cn, or aws-us-gov). | |
region | text | The AWS Region in which the resource is located. | |
sample_count | double precision | The number of metric values that contributed to the aggregate value of this data point. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
sum | double precision | The sum of the metric values for the data point. | |
timestamp | timestamp with time zone | The time stamp used for the data point. | |
unit | text | The standard unit for the data point. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- aws
You can pass the configuration to the command with the --config
argument:
steampipe_export_aws --config '<your_config>' aws_ecs_cluster_metric_cpu_utilization_daily