Monitoring CI metrics - build time, queue length etc

#1

Hi All

Is there any way to automate Monitoring of CI-related entities?

For example:

  • how long did the job take
  • how long did the whole pipeline take
  • how long did waiting in the queue take
  • how long was between git push and pipeline finish (Lead Time = waiting time + pipeline time)

We are undergoing serious redesign of our software architecture and want to see how this will affect (speed up) builds.

Also, we want to optimize the use of underlying Infrastructure - essentially having some hardware empirically find out the best configuration of VMs \ CPU cores \ concurrent runners etc - to achieve fast feedback to a developer if his\her changes have broken the pipeline.

I’ve started looking at bundled Prometheus, and it looks like it collects the following metrics:

  • ci_created_builds (which is always “No datapoints found” in my case)
  • ci_pending_builds
  • ci_running_builds
  • ci_stale_builds (always 0 in my case)

So, number of pending and running builds is great, but not enough.

I found this Prometheus exporter that calculates those metrics:

Well, I guess I can learn Ruby… and extend this exporter with whatever metrics I need from PosgreSQL.
But I’m hoping there’s an easier way to get those Build Time \ Lead Time metrics?
Gitlab API?

2 Likes

#2

Did you ever find a solution for this @boiky ?

0 Likes

#3

No, we just used standard metrics:

  • ci_pending_builds
  • ci_running_builds
0 Likes