6

Is possible to get or track what current job is running at specific runner?

For example. I have many projects and I want to tracking a runner_id=123. gitlab_api has api [url]/api/v4/runners/[runner_id] to get details of the runner=123. But the result doesn't show what I expect what job_id is now current working. so is it possible to get or tracking like this.

vatbub
  • 2,713
  • 18
  • 41
Mizugorou
  • 61
  • 4

2 Answers2

5

Based on official documents of Runners API:

List jobs that are being processed or were processed by specified Runner.

GET /runners/:id/jobs

Using query parameter status=running will get list of running jobs of the specified runner.

GET [url]/api/v4/runners/[runner_id]/jobs?status=running
Amir Dadkhah
  • 1,074
  • 2
  • 11
  • 17
0

Beside the API, GitLab 15.9 (February 2023) offers a new option:

New jobs tab in group runners page

To create a consistent runner experience across admin, group, and project views, the group runners details view now includes a list of past and current jobs that the runner runs.

Among other details, you can see the job duration, as well as how much time each job was in queue before it was picked up by the runner.

Having an overview of the queued duration can help you further analyze the runner’s queue performance.

https://about.gitlab.com/images/15_9/group-runners-job-statistics.png -- New jobs tab in group runners page

See Documentation and Issue.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250