Repository navigation
Closed
Labels
area:loggingarea:providerskind:featureFeature Requestsprovider:googleGoogle (including GCP) related issues
Description
Part of #70265 (related: #67056).
Why
#67056 decoupled remote logging from the hardcoded branches in airflow_local_settings.py: core and
the Task SDK now resolve the handler via ProvidersManager dispatch on the
[logging] remote_base_log_folder URL scheme, instantiating the provider class through a no-arg
from_config() classmethod. This issue migrates the stackdriver scheme.
What
- Add
StackdriverRemoteLogIO.from_config()in
providers/google/src/airflow/providers/google/cloud/log/stackdriver_task_handler.py,
mirroring the legacy branch:
airflow/airflow-core/src/airflow/config_templates/airflow_local_settings.py
Lines 250 to 268 in 104ad12
elif remote_base_log_folder.startswith("stackdriver://"): from airflow.providers.google.cloud.log.stackdriver_task_handler import StackdriverRemoteLogIO key_path = conf.get_mandatory_value("logging", "GOOGLE_KEY_PATH", fallback=None) # stackdriver:///airflow-tasks => airflow-tasks log_name = urlsplit(remote_base_log_folder).path[1:] REMOTE_TASK_LOG = StackdriverRemoteLogIO( **cast( "dict[str, Any]", { "base_log_folder": BASE_LOG_FOLDER, "gcp_log_name": log_name, "gcp_key_path": key_path, "delete_local_copy": delete_local_copy, } | _io_kwargs, ) )
— including the[logging] remote_task_handler_kwargsIO-kwargs merge andexpanduseron
base_log_folder, so behavior is unchanged for existing configs. - Register the
stackdriverscheme under aremote-logging:section in
providers/google/provider.yamland mirror it in
providers/google/src/airflow/providers/google/get_provider_info.py. - Add tests mirroring
TestS3RemoteLogIOFromConfigin
providers/amazon/tests/unit/amazon/aws/log/test_s3_task_handler.py. - Verify end to end with a real system test: set up the actual backend yourself (a real
service or a local equivalent), run a task with remote logging enabled, and confirm logs are
uploaded and read back through the new dispatch path. Include the setup and verification
results in the PR description.
Notes
- The legacy branch parses the log name from the URL path:
stackdriver:///airflow-tasks→
gcp_log_name="airflow-tasks"(urlsplit(...).path[1:]). Mirror this infrom_config, with a
clearValueErrorwhen no log name can be derived (see how Add CloudWatchRemoteLogIO.from_config and register cloudwatch scheme #69816 handleslog_group_arn
parsing forcloudwatch). - It also reads
[logging] google_key_path(fallbackNone) intogcp_key_path, and passes no
remote_base— unlike the other object-storage backends.
Reference
Merged examples to follow: #69817 (s3), #69816 (cloudwatch). If from_config raises on a bad
config, the shared factory falls back to the legacy path, so this is not a breaking change.
Metadata
Metadata
Assignees
Labels
area:loggingarea:providerskind:featureFeature Requestsprovider:googleGoogle (including GCP) related issues
Activity
aaron-y-chen commentedon Jul 23, 2026
I can work on it, I have a GCP account that I can use for e2e verification. Thanks!
fat-catTW commentedon Jul 23, 2026
Hello.
nailo2c said he would let me help with this issue.
I will work on it. Thanks.
aaron-y-chen commentedon Aug 3, 2026
Since #70549 has been merged, I think this PR can be closed.
jason810496 commentedon Aug 3, 2026
Yes, thanks for the reminder!