Owen-CH-Leung commented on code in PR #53821:
URL: https://github.com/apache/airflow/pull/53821#discussion_r2287792545
##########
providers/elasticsearch/src/airflow/providers/elasticsearch/log/es_task_handler.py:
##########
@@ -686,17 +688,130 @@ def _write_to_es(self, log_lines: list[dict[str, Any]])
-> bool:
self.log.exception("Unable to insert logs into Elasticsearch.
Reason: %s", str(e))
return False
+ def read(self, relative_path: str, ti: RuntimeTI) -> tuple[LogSourceInfo,
LogMessages]:
+ log_id =
f"{ti.dag_id}-{ti.task_id}-{ti.run_id}-{ti.map_index}-{ti.try_number}"
Review Comment:
Thanks. Indeed, instead of constructing the log_id via string manipulation,
we should stick with the `_render_log_id` API (which has been the case before
Airflow 3) which returns the log id to us via querying the `log_id_template`
stored in DB.
I've filed a commit to change the remote read & write flow to construct the
log_id via the `_render_log_id` API
--
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]