stantheman0128 commented on PR #71286:
URL: https://github.com/apache/airflow/pull/71286#issuecomment-6904132202
The smaller version is `62ad5a259c`.
I checked a real structlog payload from `raise RuntimeError("outer") from
ValueError("inner")`. The transformer lists `RuntimeError` first and
`ValueError` second, with `is_cause` set on the cause. `_format_error_detail`
in the Elasticsearch handler walks that list forward, so it prints the raised
exception before its cause. `traceback.format_exception` prints the cause
first. The short formatter in `shared/logging` walks the list from the end, and
that same payload ends on `RuntimeError: outer`.
The rendered text goes on the `exception` field. `PercentFormatRender`
writes that field as-is. The same multiline string in `error_detail` is escaped
onto one line. JSON logs and per-trigger task logs still keep the dicts under
`error_detail`.
The formatter is about 60 lines. The tests cover a cause chain, an implicit
context, an exception group, skipped frames, and a payload that cannot be
rendered. They do not match CPython's syntax-error caret. That caret matching
was most of the old size, and a triggerer log does not need it.
`shared/logging/tests/logging/test_tracebacks.py`: 13 passed. I did not run
the airflow-core triggerer job tests here. This machine does not have that test
environment.
Still a draft. Happy to mark it ready if this is the size you wanted.
Prepared with Cursor.
--
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]