Skip to content

feat: Add an optional task appender to AutomaticContainerLogConfig - #1255

Closed
Churi12 wants to merge 1 commit into
stackabletech:mainfrom
Churi12:feat/task-appender-log-config
Closed

feat: Add an optional task appender to AutomaticContainerLogConfig#1255
Churi12 wants to merge 1 commit into
stackabletech:mainfrom
Churi12:feat/task-appender-log-config

Conversation

@Churi12

@Churi12 Churi12 commented Jul 29, 2026

Copy link
Copy Markdown

Description

Adds a task appender to AutomaticContainerLogConfig, next to console and file.

Airflow renders a separate task handler, which is the one that feeds the log view in its web UI. Its level was not configurable, and there was no way to express it: loggers is a map so any key works, but console and file are named fields, so a sibling could not be added downstream. Setting the airflow.task logger level instead is not equivalent, since a logger threshold applies to every destination at once, whereas the point is to send DEBUG to the log files and to Vector while showing only INFO in the UI.

The field is optional and left unset by default, so the configuration rendered by every other product is unchanged. Only products with a separate task log destination use it, which today means Airflow alone.

The Merge impl for this struct is hand written rather than derived, so the field had to be added there too. Without it a level set on a role group is silently dropped, so there is a test covering both directions, and it does fail if the merge block is removed.

The consumer side is stackabletech/airflow-operator#829, which is what motivated this.

One thing worth a maintainer opinion, since it is a shared struct: a plain sibling field is the smallest change that matches stackabletech/airflow-operator#650, which is why I went with it. The alternatives would be a generic appenders map, or keeping this out of the shared struct entirely and letting Airflow carry it. Happy to rework if you would rather have one of those. I looked at additional_config as an escape hatch first, but it only exists on create_logback_config, and Airflow renders its own Python template rather than using any of the log4j or logback builders, so it does not help here.

Definition of Done Checklist

Author

  • Changes are OpenShift compatible: not applicable, no resource or image changes
  • CRD changes approved: this adds an optional field to a shared struct, see the note above
  • CRD documentation for all fields, following the style guide.
  • Changes need to be "offline" compatible

Reviewer

  • Code contains useful comments
  • (Integration-)Test cases added
  • Changelog updated
  • Cargo.toml only contains references to git tags (not specific commits or branches)

Airflow renders a separate task handler which is what feeds the log view
in its web UI. Its level was not configurable, because console and file
are named fields on this struct while loggers is a map, so there was no
place in the CRD to express it.

Add a task appender next to console and file. It defaults to unset, so
the configuration rendered by every other product is unchanged.

The hand written Merge impl needs the field too, otherwise a level set on
a role group is silently dropped, so a test covers that.
@Churi12

Churi12 commented Jul 29, 2026

Copy link
Copy Markdown
Author

Closing this. Discussion is on stackabletech/airflow-operator#829: the preference is to not add a field to a shared struct that only Airflow would use, and to carry the level in a magic airflow.task key in loggers instead. That needs no CRD change at all, so this is not needed.

Thanks @sbernauer for the steer.

@Churi12 Churi12 closed this Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants