CloudWatch Logs Insights is a fully integrated, interactive, and pay-as-you-go log analytics service for CloudWatch. CloudWatch Logs Insights enables you to explore, analyze, and visualize your logs instantly, allowing you to troubleshoot operational problems with ease.
Navigate to CloudWatch Logs Insights and select /aws/ecs/containerinsights/cluster-name/performance Log Group as shown below
Copy and paste the following query into the textbox and click Run query
stats count_distinct(TaskId) as Number_of_Tasks by ServiceName
This query returns a table showing the number of Tasks running by Service as shown below
The following query returns a table showing the average Memory and CPU Utilized by Tasks every 5 minutes using the filter command
stats avg(MemoryUtilized) as Avg_Memory, avg(CpuUtilized) as Avg_CPU by bin(5m) | filter Type="Task"
You can also visualize the output on a graph by simply clicking on the Visualization tab. The following screenshot shows a bar chart of the same report