You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
update watchtower version in amazon provider #25019
Would you like to attempt it @alexInhert ? I marked it as good first issue so maybe someone will pick it up, but if you need it badly then the most certain way is to implement it yourself,
@potiuk, We have no immediate plans, our needs are covered by at least 2.0.1, but I think upgrading is still a good idea! I can assist @alexInhert if they get stuck, since I've done version bumps for Watchtower in the past.
But note: This change will need a careful check of Airflow logs, since v3 of Watcher can now include much more information in the logs than previous (due to lacking json deserialization support many things were previously just logged as null but which now are logged in full)
We have the option to override the default-json serializer to whatever we want. I would propose that we override this to preserve the 2.x behavior with a config option to allow opt-in to the new repr format using logging.REMOTE_LOG_KWARGS (a new config). This way we can upgrade to 3.x, but keep the old serializer.
defjson_serialize_legacy(o):
""" The legacy `watchtower@2.0.1` json serializer function that serialized datetime objects as ISO format andall other non-JSON-serializable to `null` """ifisinstance(o, (date, datetime)):
returno.isoformat()
...
classCloudwatchTaskHandler(FileTaskHandler, LoggingMixin):
...
def__init__(self, base_log_folder: str, log_group_arn: str, filename_template: str|None=None):
...
remote_log_options: Dict[str, Any] =conf.get("logging", "REMOTE_LOG_KWARGS", {})
self.opt_in_new_json_serialize=remote_log_options.get("opt_in_new_json_serialize", False)
...
defset_context(self, ti):
super().set_context(ti)
self.handler=watchtower.CloudWatchLogHandler(
...
json_serialize_default=Noneifself.opt_in_new_json_serializeelsejson_serialize_legacy,
)
This is my first interaction with this project, so I understand if it's not desirable to add config like this, just brainstorming. Let me know what you guys think.
Activity
potiuk commentedon Jul 13, 2022
Would you like to attempt it @alexInhert ? I marked it as good first issue so maybe someone will pick it up, but if you need it badly then the most certain way is to implement it yourself,
potiuk commentedon Jul 13, 2022
Or maybe @ferruzzi or @o-nikolas - this is already somehow planned by the MWAA team :) ?
o-nikolas commentedon Jul 15, 2022
@potiuk, We have no immediate plans, our needs are covered by at least
2.0.1, but I think upgrading is still a good idea! I can assist @alexInhert if they get stuck, since I've done version bumps for Watchtower in the past.But note: This change will need a careful check of Airflow logs, since v3 of Watcher can now include much more information in the logs than previous (due to lacking json deserialization support many things were previously just logged as
nullbut which now are logged in full)cBiscuitSurprise commentedon Sep 29, 2023
I would like to give this issue a try.
We have the option to override the default-json serializer to whatever we want. I would propose that we override this to preserve the 2.x behavior with a config option to allow opt-in to the new
reprformat usinglogging.REMOTE_LOG_KWARGS(a new config). This way we can upgrade to 3.x, but keep the old serializer.This is my first interaction with this project, so I understand if it's not desirable to add config like this, just brainstorming. Let me know what you guys think.
cBiscuitSurprise commentedon Oct 2, 2023
Is this class deprecated? Would that make this issue a non-issue (and I should find another issue)?
airflow/airflow/utils/log/__init__.py
Lines 23 to 28 in 6618c5f
Upgrade watchtower to 3.0.1 (#25019) (#34747)