Skip to content

ElasticSearch / Opensearch Task Handler does not render task log well #53526

@Owen-CH-Leung

Description

@Owen-CH-Leung

Apache Airflow Provider(s)

elasticsearch

Versions of Apache Airflow Providers

Airflow 3

Apache Airflow version

3

Operating System

Debian GNU/Linux 12 (bookworm)

Deployment

Docker-Compose

Deployment details

I use breeze to start an airflow

breeze start-airflow --executor CeleryExecutor --backend postgres --load-example-dags --db-reset

What happened

In Airflow 3, the api-server renders well-formatted task logs that allows filtering based on log level. For example, the following is the rendered task logs when using FileTaskHandler (disabling remote logging)

Image

However, when using ElasticsearchTaskHandler (And OpensearchTaskHandler), the logs are not rendered nicely:

Image

What you think should happen instead

ElasticsearchTaskHandler or OpensearchTaskHandler should render the task log nicely, just like FileTaskHandler

How to reproduce

Run breeze start-airflow --executor CeleryExecutor --backend postgres --load-example-dags --db-reset to start a local airflow. Trigger any of the DAG run. Ship the task logs to ElasticSearch / Opensearch. Then try to read task log from the webUI

Anything else

As a sidenote, in the webUI, when using FileTaskHandler, it displays the file path of the task log. But when using ElasticSearchTaskHandler, it displays that the source is default_host which is confusing. I think it should display the hostname of the ElasticSearch

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions