pulumi-awsx
pulumi-awsx copied to clipboard
[ECS] Container name is used for default awslogs-steam-prefix, is redundant
Current implementation uses containerName as default awslogs-stream-prefix.
"awslogs-stream-prefix": containerName,
According to the document, final stream name is prefix-name/container-name/ecs-task-id. So we'll get container-name/container-name/ecs-task-id (also, our default container name is container).
I think It'd be better to use parent name, like service name or task definition name. Then we are also able to easily use shared logGroup for entire cluster, like:
- logGroup: cluster-prod
- rails/app/...
- rails/sidecar/...
- nginx/app/...
- ...
Related: #435
Yes, that makes sense. And is very much in line with what AWS recommends:
For Amazon ECS services, you could use the service name as the prefix, which would allow you to trace log streams to the service that the container belongs to, the name of the container that sent them, and the ID of the task to which the container belongs.
@lukehoban for thoughts here. I believe this would be a good change, but will likely have to be considered a break as it will definitely affect existing resources.
That said, we could likely pair this with support/documentation as to how to update to this version of Pulumi while also maintaining your existing log structure. That feels like it would then pass our compat bar (esp. as awsx is still not 1.0).