hanxdatadog commented on PR #71793: URL: https://github.com/apache/airflow/pull/71793#issuecomment-6537917228
> Who needs Dag tags in task logs, and why isn't a listener enough? The description notes that a listener plugin can already bind them, and `on_task_instance_running` has the Dag's tags in scope. A `[logging] dag_tags_in_logs` option is permanent config surface, and free-form tags become arbitrary structlog keys, so a tag like `level:x` or `logger:x` would collide with the standard fields. Is there an issue or a user asking for this? Converting to draft until there is. Hi @kaxil, tysm for reviewing. in Datadog we do a multi-team/tenancy deployment of Airflow, so in some cases we would like to have dag tags in the log attributes (for example, team tag, owner/extra owner tags). This is helpful for us to quickly/correctly identify the right owner of errors/failures. We are using a listener approach in our current deployment, but as explained in this issue https://github.com/apache/airflow/issues/76104, it would be nicer to have dag tags available in the entire lifecycle of a task but listener only gets us so much(mostly but will miss some early logs). additionally, a more native Airflow DAG log context binding is easier/safer to clean up when tasks fail/get killed. Let me know if you feel this feature doesn't make sense. We were just hoping to bring this feature upstream using a more airflow native approach in case anyone finds it useful. and welcome any feedback. 🙇 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
