Skip to content

Document OpenSearch logging override needed on Airflow 3.0.0 – 3.2.0#65209

Merged
potiuk merged 3 commits into
apache:mainfrom
potiuk:docs/opensearch-3-0-3-2-local-settings
Apr 14, 2026
Merged

Document OpenSearch logging override needed on Airflow 3.0.0 – 3.2.0#65209
potiuk merged 3 commits into
apache:mainfrom
potiuk:docs/opensearch-3-0-3-2-local-settings

Conversation

@potiuk

@potiuk potiuk commented Apr 14, 2026

Copy link
Copy Markdown
Member

The OpenSearch task handler wiring in the stock airflow_local_settings.py only landed in Airflow 3.2.1. On Airflow 3.0.0 – 3.2.0 the provider alone is not enough to read OpenSearch-stored task logs back into the Airflow UI — users must ship a custom logging_config_class that swaps the task handler so the UI's log viewer can fetch logs from OpenSearch.

To be clear about scope: this is only about accessing logs in the UI. Tasks running on workers will still write logs as usual (to local files, stdout, or — with appropriate shipping — to OpenSearch). Without the override on 3.0.0 – 3.2.0, those logs reach OpenSearch fine but the UI cannot render them because no handler is registered to read them back.

This adds a new section to providers/opensearch/docs/logging/index.rst that:

  • Notes that only apache-airflow-providers-opensearch 1.9.0+ is compatible with Airflow 3.
  • Provides a copy-pasteable custom airflow_local_settings.py snippet that wires OpensearchTaskHandler so the UI can read logs from OpenSearch on Airflow 3.0.0 – 3.2.0.
  • Explains that on 3.2.1+ the override is unnecessary — the stock settings file already contains the OPENSEARCH_HOST branch.
  • Warns that the write_to_os = True direct-write path also depends on supervisor plumbing only fully wired in 3.2.1+, so on 3.0.0 – 3.2.0 users should still ship logs with fluentd / logstash.

Docs-only change.


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (Opus 4.6)

Generated-by: Claude Code (Opus 4.6) following the guidelines

The wiring of OpensearchTaskHandler in the stock airflow_local_settings.py
landed in Airflow 3.2.1. On 3.0.0 – 3.2.0 users must ship a custom
logging_config_class to swap the task handler. Document the override and
note that only provider 1.9.0+ is compatible with Airflow 3.
@potiuk

potiuk commented Apr 14, 2026

Copy link
Copy Markdown
Member Author

cc: @Owen-CH-Leung @wjddn279

Make explicit in the doc that the airflow_local_settings.py override
is only needed so the Airflow UI can read task logs back from OpenSearch
on 3.0.0 – 3.2.0. Workers write logs as usual either way.

@Owen-CH-Leung Owen-CH-Leung left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Very clear summary. Thanks!

Indeed the 1.9.0 provider only works with Airflow 3+. It won't work in Airflow 2 without an override like you mentioned

Comment thread providers/opensearch/docs/logging/index.rst Outdated
Earlier provider versions can still be installed on Airflow 3.x — they
just cannot render task logs from OpenSearch in the UI.
@potiuk
potiuk force-pushed the docs/opensearch-3-0-3-2-local-settings branch from 035af41 to 9aee4b5 Compare April 14, 2026 20:54
@potiuk
potiuk merged commit 2760959 into apache:main Apr 14, 2026
8 checks passed
@potiuk
potiuk deleted the docs/opensearch-3-0-3-2-local-settings branch April 14, 2026 20:54
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.

3 participants