feat: Add an optional task appender to AutomaticContainerLogConfig - #1255
Closed
Churi12 wants to merge 1 commit into
Closed
feat: Add an optional task appender to AutomaticContainerLogConfig#1255Churi12 wants to merge 1 commit into
Churi12 wants to merge 1 commit into
Conversation
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.
Open
5 tasks
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Reviewer