turbot/alicloud_insights

Query: rds_instance_top10_cpu_past_week

Usage

powerpipe query alicloud_insights.query.rds_instance_top10_cpu_past_week

SQL

with top_n as (
select
db_instance_id,
avg(average)
from
alicloud_rds_instance_metric_cpu_utilization_daily
where
timestamp >= CURRENT_DATE - INTERVAL '7 day'
group by
db_instance_id
order by
avg desc
limit 10
)
select
timestamp,
db_instance_id,
average
from
alicloud_rds_instance_metric_cpu_utilization_hourly
where
timestamp >= CURRENT_DATE - INTERVAL '7 day'
and db_instance_id in (select db_instance_id from top_n)
order by
timestamp;

Dashboards

The query is used in the dashboards: