Inconsistent usage of awslogs_stream_prefix #43130
Labels
area:providers
good first issue
kind:bug
This is a clearly a bug
provider:amazon
AWS/Amazon - related issues
Apache Airflow Provider(s)
amazon
Versions of Apache Airflow Providers
apache-airflow-providers-amazon==8.29.0
Apache Airflow version
2.9.2
Operating System
Amazon Linux 2023.5.20240805
Deployment
Amazon (AWS) MWAA
Deployment details
Using a Python 3.11 environment with botocore==1.34.106 and apache-airflow-providers-amazon==8.29.0.
What happened
The code for EcsRunTaskOperator looks for log streams by using the pattern
prefix-name/ecs-task-id
:In the AWS ECS docs for LogConfiguration, log streams are created using the pattern
prefix-name/container-name/ecs-task-id
.What you think should happen instead
EcsRunTaskOperator should follow the same log stream naming convention as specified in the AWS ECS docs.
Because this isn't the case, you need to specify a stream prefix using a different pattern when registering your task vs. when running your task.
How to reproduce
containerDefinition
containing at least the following:The logs in your ECS task will be uploaded to CloudWatch under the log group
my-log-group
and the prefixmy-container-prefix/my-container-name/task-id
.awslogs-stream-prefix
.my-log-group
and prefixmy-container-prefix/task-id
.Anything else
The only workaround for this issue is to specify the task definition's
awslogs-stream-prefix
withmy-prefix-name
and the EcsRunTaskOperator'sawslogs_stream_prefix
withmy-prefix-name/my-container-name
.Are you willing to submit PR?
Code of Conduct
The text was updated successfully, but these errors were encountered: