Hello and thank you for creating Google Cloud Batch.
Problem statement
First, it's currently impossible to view the task list and the state of each task in the web UI. We can only see how many tasks are in each state. As a workaround, it's possible to see the task list with this command:
$ gcloud batch tasks list --job projects/#########/locations/us-central1/jobs/job-0015 --sort-by ~STATE
NAME STATE
projects/#########/locations/us-central1/jobs/job-0015/taskGroups/group0/tasks/0 SUCCEEDED
projects/#########/locations/us-central1/jobs/job-0015/taskGroups/group0/tasks/1 SUCCEEDED
projects/#########/locations/us-central1/jobs/job-0015/taskGroups/group0/tasks/2 FAILED
Second, it's currently cumbersome to view the log of a particular task in the web UI. Here's one way to do it:
- Go to the Logs tab.
- Expand a log line of an arbitrary task.
- Expand the
labels object
- Copy the
task_id field and value.
- In the filter bar, type
labels. and paste the task_id field and value so the filter looks similar to this: labels.task_id: "job##########-group0-1".
- Press Enter to apply the filter which will now show the log only from that task.
- Click the View in Logs Explorer button which will take you to the Logs Explorer.
- If you want to view the log from a different task, change the task index after
group0-. For example, labels.task_id: "job##########-group0-2".
- Click Run Query to see the log from this other task.
As a workaround, we can use this command to see the tail of the log for a specific task:
$ gcloud logging read 'timestamp<="2025-07-04T03:02:07.932Z" labels.task_id="job##############-group0-0"' --limit=30
--format='value(textPayload)' | tac
2025-07-04 01:50:37,553 - Last
2025-07-04 01:50:37,558 - few
2025-07-04 01:50:37,559 - log
2025-07-04 01:50:37,560 - lines
But to use this command, we first need to grab the job uid from either the web UI or the gcloud batch jobs submit/describe command and we need to supply a timestamp.
Proposed feature
In addition to the Details, Events, and Logs tabs, there can be a Tasks tab. In this tab, there can be a table/list of tasks with the following fields: Task ID and/or BATCH_TASK_INDEX, State, a link to the log for this task. It should be possible to sort the list by State. Clicking on the log link can open either the Logs tab with the correct filter or the Logs Explorer with the correct query for this task.
Thank you for your consideration!
Hello and thank you for creating Google Cloud Batch.
Problem statement
First, it's currently impossible to view the task list and the state of each task in the web UI. We can only see how many tasks are in each state. As a workaround, it's possible to see the task list with this command:
Second, it's currently cumbersome to view the log of a particular task in the web UI. Here's one way to do it:
labelsobjecttask_idfield and value.labels.and paste thetask_idfield and value so the filter looks similar to this:labels.task_id: "job##########-group0-1".group0-. For example,labels.task_id: "job##########-group0-2".As a workaround, we can use this command to see the tail of the log for a specific task:
But to use this command, we first need to grab the job
uidfrom either the web UI or thegcloud batch jobs submit/describecommand and we need to supply a timestamp.Proposed feature
In addition to the Details, Events, and Logs tabs, there can be a Tasks tab. In this tab, there can be a table/list of tasks with the following fields: Task ID and/or BATCH_TASK_INDEX, State, a link to the log for this task. It should be possible to sort the list by State. Clicking on the log link can open either the Logs tab with the correct filter or the Logs Explorer with the correct query for this task.
Thank you for your consideration!