bottlerocket icon indicating copy to clipboard operation
bottlerocket copied to clipboard

What is the best way to monitor the MemoryUtilization for a Bottlerocket Container instance for ECS

Open danblacklist opened this issue 1 year ago • 4 comments

Image I'm using: ami-0af64c4e3fc6bf8d2

I'd like to monitor the MemoryUtilization at the instance (host) level for my ECS container instances running the Bottlerocket AMI, what is the recommended approach ? Container Insights ?

danblacklist avatar Sep 15 '24 04:09 danblacklist

I have the same exact question, also for ECS

What is the recommended way to monitor memory utilization on a Bottlerocket for ECS instance?

So I could create a CloudWatch alarm to alert me if an container instance is low on available memory

brian-mertens avatar Sep 16 '24 18:09 brian-mertens

Hello @danblacklist / @brian-mertens , ideally, one could use Container Insights for instance level metrics. However, the feature doesn't work in Bottlerocket because we have a patch of the ECS agent that prevents container insights from working as expected. I'll follow up with the team that owns Container Insights to make this work for Bottlerocket.

In the meantime, I've been thinking about how users could deploy a somewhat privileged task to extract the information required from the host using either CloudWatch or Fluentbit. I'll check with the team to align on the suggestion we want to make before we post it here so that you all have a mechanism to extract what you need.

arnaldo2792 avatar Sep 17 '24 04:09 arnaldo2792

Hi @arnaldo2792 !

I see I can do $ cat /proc/meminfo from the control container and admin container shells

Could I create a small task that reads from /proc/meminfo or do tasks not have that privilege?

brian-mertens avatar Sep 17 '24 18:09 brian-mertens

ok I feel dumb - I just found the built-in ECS MemoryUtilization cloudwatch metric

pushed by the ecs-agent I would guess

brian-mertens avatar Sep 19 '24 20:09 brian-mertens