Skip to content

fix(google): use run_id instead of logical_date in StackdriverRemoteLogIO.read() filter#68249

Open
goingforstudying-ctrl wants to merge 1 commit into
apache:mainfrom
goingforstudying-ctrl:fix/stackdriver-read-run-id
Open

fix(google): use run_id instead of logical_date in StackdriverRemoteLogIO.read() filter#68249
goingforstudying-ctrl wants to merge 1 commit into
apache:mainfrom
goingforstudying-ctrl:fix/stackdriver-read-run-id

Conversation

@goingforstudying-ctrl

Copy link
Copy Markdown

Fixes Bug 2 from #68240.

What

StackdriverRemoteLogIO.read() currently builds its Cloud Logging filter from
_task_instance_to_labels(), which includes logical_date. In Airflow 3's
supervisor model the REMOTE_TASK_LOG handler runs in the supervisor process,
which has no DB connection to convert run_idlogical_date. The filter
either crashes or returns no results.

Fix

read() now constructs the filter labels directly using run_id instead of
logical_date. This matches the write path (Bug 1 / #68246) which already
emits run_id as a label extracted from the log path.

The _task_instance_to_labels() helper (used by the webserver-side
StackdriverTaskHandler) is left unchanged to avoid breaking log reads for
existing deployments that have logical_date labels.

Changes

  • Added LABEL_RUN_ID constant
  • StackdriverRemoteLogIO.read() builds filter from {dag_id, task_id, run_id, try_number} — no logical_date
  • Updated tests: existing test_read_logs / test_read_logs_empty
  • New test test_read_logs_uses_run_id_filter verifies run_id in filter and absence of logical_date

relates to #68240

…ogIO.read() filter

In AF3's supervisor model the REMOTE_TASK_LOG handler runs in the
supervisor process, which has no DB connection to convert run_id to
logical_date.  The read path now filters on run_id directly, consistent
with the write path that already emits run_id as a label (Bug 1).

relates to apache#68240
@goingforstudying-ctrl goingforstudying-ctrl force-pushed the fix/stackdriver-read-run-id branch from 07ba3ad to fa203ef Compare June 10, 2026 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:logging area:providers provider:google Google (including GCP) related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant