containers-roadmap icon indicating copy to clipboard operation
containers-roadmap copied to clipboard

[ECS] [request]: Allow setting log retention for awslog driver

Open jsha09 opened this issue 3 years ago • 4 comments

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Tell us about your request Currently, setting the log retention period via awslog driver isn't available, it would be great to have the ability to set this.

https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_awslogs.html#create_awslogs_logdriver_options

Which service(s) is this request for? This could be Fargate, ECS

jsha09 avatar Apr 12 '21 01:04 jsha09

Hi @jsha09, thanks for letting us know your request! Considering the logConfiguration is a part of task definition, it can be different in each task definition revision across the same task def family. So what do you expect (or the best behavior for you) when a new task def revision defines it "7 days" which was originally "3 days" for example? Also what do you expect to happen in the case of tasks' rollback?

toricls avatar May 08 '21 01:05 toricls

I'm not the original reporter, but I'd expect it to use the latest task definition. In your example I'd expect the retention to be 7 days. If the task is rolled back, I'd expect it to go back to 3 days.

seeljugh avatar Aug 09 '22 16:08 seeljugh

Are there workarounds to this? How do we set the retention of such log groups?

g3kr avatar Sep 12 '22 17:09 g3kr

@toricls this is blocking us from having firm controls on our CW log groups. We are working on cost reduction across thousands of log groups spanning thousands of clusters. Is there a workaround suggested?

g3kr avatar Sep 14 '22 13:09 g3kr