Skip to content

feat(core): make elasticsearch compatible with remote_task_log#62121

Draft
Owen-CH-Leung wants to merge 3 commits intoapache:mainfrom
Owen-CH-Leung:core/make-es-compatible-with-remote-log-io
Draft

feat(core): make elasticsearch compatible with remote_task_log#62121
Owen-CH-Leung wants to merge 3 commits intoapache:mainfrom
Owen-CH-Leung:core/make-es-compatible-with-remote-log-io

Conversation

@Owen-CH-Leung
Copy link
Contributor

@Owen-CH-Leung Owen-CH-Leung commented Feb 18, 2026

fixes: #50349
Fixes: #51456

This is the airflow-core counterpart to #53821, which together restore the write_to_es Elasticsearch logging feature broken in Airflow 3.

airflow_local_settings.py previously configured Elasticsearch logging by injecting ElasticsearchTaskHandler directly into the logging handler dict. In Airflow 3, remote log writing goes through a REMOTE_TASK_LOG object implementing the RemoteLogIO interface. This PR updates the config template to set REMOTE_TASK_LOG = ElasticsearchRemoteLogIO(...)

The minimum required version of apache-airflow-providers-elasticsearch is also bumped to >=6.5.0 (the release containing ElasticsearchRemoteLogIO) in the dependency constraints.

elif ELASTICSEARCH_HOST:
ELASTICSEARCH_END_OF_LOG_MARK: str = conf.get_mandatory_value("elasticsearch", "END_OF_LOG_MARK")
ELASTICSEARCH_FRONTEND: str = conf.get_mandatory_value("elasticsearch", "frontend")
from airflow.providers.elasticsearch.log.es_task_handler import ElasticsearchRemoteLogIO
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need also min elastic version in

MIN_VERSION_OVERRIDE: dict[str, Version] = {

Because we know this won't work with older version of elastic provider

Need to verify with @potiuk this is the right way to proceed

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it depends on whether there is min version that will work here.

Copy link
Contributor Author

@Owen-CH-Leung Owen-CH-Leung Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added "elasticsearch": parse_version("6.5.0") which should be the next es provider version release after the provider mr is merged.

@jason810496 jason810496 self-requested a review February 18, 2026 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

airflow no writing logs to Elasticsearch Logs are not integrating with elasticsearch

3 participants